Destination Sprite

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
136
Reaction score
103
First Language
Ukrainian

Destination Sprite v1.2.3


By Krimer


Introduction


With this plugin you can change the destination place sprite of the mouse\touch input


Features
- Easy to use.
- Resize, recolor the destination sprite
- You can use custom image as the destination sprite


- Choose animation mode


Screenshots





How to Use

  1. Create file with name DestinationSprite.js

  2. add file to /plugin folder of your project

  3. Activate DestinationSprite in plugin manager

Script

Code:
//=============================================================================
// DestinationSprite.js
// Version: 1.2.3
//=============================================================================
var Imported = Imported || {};
Imported.Krimer_DestinationSprite = true;

//=============================================================================
/*:
 * @plugindesc v1.2.3 - With this plugin you can change the destination place sprite of the mouse\touch input.
 * <DestinationSprite>
 * @author Krimer
 *
 * @param Sprite Figure
 * @desc Sprite type. It can be - Square, Circle, or Off = hide sprite. For custom image set value to - Custom. Def:Square
 * @default Square
 *
 * @param Custom Image
 * @desc Active only if "Sprite Figure" set to "Custom". Write a name of your custom image in folder '/img/system'
 * @default image
 *
 * @param Animation mode
 * @desc Setup animation mode. Can be: Blink => standard RMMV animation; Fade => fade sprite once per click. Def:blink
 * @default blink
 *
 * @param Fade speed
 * @desc Sprite opacity decrease per frame. Active only if "Animation mode" set to "fade". Def:12
 * @default 12
 *
 * @param Sprite Size
 * @desc Sprite Size in pixels. Ignore if "Sprite Figure" set to "Custom". Default: 48
 * @default 48
 *
 * @param Sprite Color
 * @desc Sprite Color. Link where you can choose color is in "Help". Ignore if "Sprite Figure" set to "Custom". Default: #ffffff
 * @default #ffffff
 *
 * @param Sprite Opacity
 * @desc Set the sprite opacity. Write a number in range 0..255. Default: 120
 * @default 120
 *
 * @param Sprite Blend
 * @desc Set the blend mode for the destination sprite. 0=NORMAL, 1=ADD
 * Default: 1
 * @default 1
 *
 * @help Color picker can be found here or you can use any graphic editor with hex color codes:
 * http://www.w3schools.com/tags/ref_colorpicker.asp
 * Recommended size for Custom Images is 48x48 or not higher than your tiles size
 */
//=============================================================================

(function() {
    function capitalizeFirstLetter(string) {
        return string.charAt(0).toUpperCase() + string.slice(1);
    }
  
    var parameters = $plugins.filter(function(p) {
        return p.description.contains('<DestinationSprite>');
    })[0].parameters;
    var dSpriteFigure = capitalizeFirstLetter(String(parameters['Sprite Figure'] || 'Square'));
    var dAnimationMode = capitalizeFirstLetter(String(parameters['Animation mode'] || 'Blink'));
    var dFadeSpeed = String(parameters['Fade speed'] || '12');
    var dSpriteColor = String(parameters['Sprite Color'] || '#ffffff');
    var dSpriteSize = Number(parameters['Sprite Size']);
    var dCustomImage = String(parameters['Custom Image']);
    var dSpriteOpacity = Number(parameters['Sprite Opacity']);
    var dSpriteBlend = Number(parameters['Sprite Blend']);

    Sprite_Destination.prototype.createBitmap = function() {
        var tileWidth = dSpriteSize || $gameMap.tileWidth();
        var tileHeight = dSpriteSize || $gameMap.tileHeight();
        this.bitmap = new Bitmap(tileWidth, tileHeight);
        if (dSpriteFigure == 'Square') {
            this.bitmap.fillAll(dSpriteColor);
        } else if (dSpriteFigure == 'Circle') {
            this.bitmap.drawCircle(this.bitmap.width / 2, this.bitmap.height / 2, dSpriteSize / 2, dSpriteColor);
        } else if (dSpriteFigure == 'Off') {} else if (dSpriteFigure == 'Custom') {
            this.bitmap = ImageManager.loadSystem(dCustomImage)
        }
        this.anchor.x = 0.5;
        this.anchor.y = 0.5;
        this.blendMode = (dSpriteBlend == 1) ? Graphics.BLEND_ADD : Graphics.BLEND_NORMAL;
    };

    Sprite_Destination.prototype.updateAnimation = function() {
        this._frameCount++;
        this._frameCount %= 20;
        if (dAnimationMode == "Blink") {
            this.opacity = dSpriteOpacity === 255 ? 255 : Math.floor(dSpriteOpacity / 6 - this._frameCount) * 6;
            this.scale.x = 1 + this._frameCount / 20;
            this.scale.y = this.scale.x;
        } else if (dAnimationMode == "Fade" && $gameTemp.getDestinationOpacity() > 0) {
            this.opacity = $gameTemp.getDestinationOpacity() - dFadeSpeed;
            $gameTemp.setDestinationOpacity(this.opacity);
        }
    };

    var Game_Temp_initialize_dAlias = Game_Temp.prototype.initialize;
    Game_Temp.prototype.initialize = function() {
        Game_Temp_initialize_dAlias.call(this);
        this._destinationOpacity = null;
    };

    Game_Temp.prototype.setDestinationOpacity = function(value) {
        this._destinationOpacity = value;
    };

    Game_Temp.prototype.getDestinationOpacity = function() {
        return this._destinationOpacity;
    };

    var Game_Temp_setDestination_dAlias = Game_Temp.prototype.setDestination;
    Game_Temp.prototype.setDestination = function(x, y) {
        if (dAnimationMode == "Fade" && (this._destinationX !== x || this._destinationY != y)) {
            this._destinationOpacity = 255;
        }
        Game_Temp_setDestination_dAlias.call(this, x, y);

    };
})();



Author's Notes


Sorry my English is not that good but i want to share my first plugin with you.


Free to use. You can use it as you want. If you want you can write my name in credits or not :)
 
Last edited:

VanillaBrocker

Veteran
Veteran
Joined
Jul 25, 2015
Messages
68
Reaction score
81
First Language
Portuguese
Primarily Uses
Thanks! I always hated the square shape on click. Haha!
 
 

Cvrtis

Veteran
Veteran
Joined
Sep 9, 2013
Messages
238
Reaction score
120
First Language
Russian
Primarily Uses
Cool! It solved this problem for me:



Is it possible to add some options like changing transparence? And more different shapes (for example, a cross, or a, err, heart, star)? Or maybe we can loat a picture for shape by ourself?
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,271
Reaction score
2,330
First Language
Binary
Primarily Uses
RMMV
awwww dayum :/

I didnt even realize someone had done this when I made my plugin for it the other day :'(
 

Cvrtis

Veteran
Veteran
Joined
Sep 9, 2013
Messages
238
Reaction score
120
First Language
Russian
Primarily Uses
awwww dayum :/

I didnt even realize someone had done this when I made my plugin for it the other day :'(
I saw minimum 3 "Skip Title" plugins. And all with different code.

And You are too well known to be sad by such things.

Maybe he can make the same by other way.

On other hand, You can compare Your work and develop Your skill.

UPD. Sorry, I changed my comment.
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,271
Reaction score
2,330
First Language
Binary
Primarily Uses
RMMV
I already looked at the code to compare. I feel mine is the better plugin, but thats not relevant to the fact this one seems to do the job fine too :D
 

Cvrtis

Veteran
Veteran
Joined
Sep 9, 2013
Messages
238
Reaction score
120
First Language
Russian
Primarily Uses
I already looked at the code to compare. I feel mine is the better plugin, but thats not relevant to the fact this one seems to do the job fine too :D
I hope he will not leave a plugin because someone passed him. Because now he can do it better then Your plugin  :guffaw:

Anyway, I will waiting.
 
Last edited by a moderator:

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
136
Reaction score
103
First Language
Ukrainian
awwww dayum :/


I didnt even realize someone had done this when I made my plugin for it the other day :'(
Its fine :) My plugin is for anyone who looking for something simple or just want to hide destination sprite(hide was the main reason for this plugin). Your plugin much better :)

Cool! It solved this problem for me:





Is it possible to add some options like changing transparence? And more different shapes (for example, a cross, or a, err, heart, star)? Or maybe we can loat a picture for shape by ourself?
I think we can speak russian here? Because for me its more easier to talk.

Я просто немного не понял, ты хочешь чтобы я поправил то, что на скрине? Или как? Если да, то когда это происходит? возможно это из-за небольшого конфликта плагинов.


Насчет других форм и прозрачности, то я посмотрю, что из этого выйдет. Но как я говорил, этот плагин и не рассчитывался как что-то сильно крутое с кучей настроек
 
Last edited by a moderator:

Cvrtis

Veteran
Veteran
Joined
Sep 9, 2013
Messages
238
Reaction score
120
First Language
Russian
Primarily Uses
Its fine :) My plugin is for anyone who looking for something simple or just want to hide destination sprite(hide was the main reason for this plugin). Your plugin much better :)

I think we can speak russian here? Because for me its more easier to talk.

Я просто немного не понял, ты хочешь чтобы я поправил то, что на скрине? Или как? Если да, то когда это происходит? возможно это из-за небольшого конфликта плагинов.

Насчет других форм и прозрачности, то я посмотрю, что из этого выйдет. Но как я говорил, этот плагин и не рассчитывался как что-то сильно крутое с кучей настроек :)
Nope! Forbidden! I'm serious :)

I will write to the PM.
 

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
136
Reaction score
103
First Language
Ukrainian
Plugin was updated to version 1.1

  • Now you can set custom image as destination sprite
  • customize opacity
  • on/off blend mode.
 

Cvrtis

Veteran
Veteran
Joined
Sep 9, 2013
Messages
238
Reaction score
120
First Language
Russian
Primarily Uses
Yaw, You are so fast! I did not expect so soon update  :D

UPD.

On screenshot it looks not so funny  :(

 
Last edited by a moderator:

Fullereno

Veteran
Veteran
Joined
Nov 2, 2015
Messages
61
Reaction score
15
First Language
Spanish
Primarily Uses
I've been looking for something like this for so long... Thank you sooooo much :D
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,608
Reaction score
1,405
First Language
French
Primarily Uses
RMMV
@Krimer


nice thanks a lot friend.


Q: if i add custom image, we able to disable blinking and make only a fadeout ?
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,608
Reaction score
1,405
First Language
French
Primarily Uses
RMMV
No In current version.


What do you mean by fadeout?
something like this, 
Remove the blinking and only do one fade out when click to a position.


 

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
136
Reaction score
103
First Language
Ukrainian
Plugin was updated to version 1.2

  • Some minor changes
  • Added animation mode

Now you can choose between standard RMMV animation and fade animation once per click. 


I changed opacity setting so pay attention to it and set it to new format.

 
Last edited by a moderator:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,608
Reaction score
1,405
First Language
French
Primarily Uses
RMMV
really awesome thank friend
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

World Of Final Fantasy Livestream~!
(Ft. Kaliga)
So my office building has 8 individually rented offices in it; 3 of which are social workers and 2 are marriage therapists... Unsurprisingly it always sound very angry out there. Glad I have my own private entrance. :LZSexcite: :thumbsup-right:
I wonder if there's ever been an art challenge that involves drawing faces from the generator.
I'm sorry about earlier. I have the most hate and the most love for my art at the same time. Felt bad about my thread because I wasn't listening, and because I made it out of a bad mindset to begin with. S'another Thursday for me.

Forum statistics

Threads
94,369
Messages
920,364
Members
124,136
Latest member
prox
Top