Joined
Sep 27, 2017
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Great work- thank you!
It seems like the fade option doesn't work well with Quxios's QMovement (It stays solid). Everything else does, though, and a quick custom sprite makes the ugly old block look a bit polished.
 
Last edited:

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
150
Reaction score
114
First Language
Ukrainian
Great work- thank you!
It seems like the fade option doesn't work well with Quxios's QMovement (It stays solid). Everything else does, though, and a quick custom sprite makes the ugly old block look a bit polished.
I don't see any problem with QMovement. Maybe you write "fade" like "Fade" in plugin options? :) I didn't foresee this, so I add new version where this is no more a problem, now you can write as you want :)
 
Joined
Sep 27, 2017
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
It's just not working out for me. I've updated the script, and changed the capitalization. Fading works if QMovement is off, but is solid when QMovement is on.
It's fine, though. The blinking looks just as good with the custom sprite! You don't have to stress too hard over my little incompatibility issue.

EDIT: Actually, the sprite kinda spazzes out, flickering and doing different things if you can keep it on long enough to notice. I still don't know what's causing the issue though :/
 
Last edited:
Joined
Sep 27, 2017
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ah! That was it! It works beautifully now!
Thank you so much!

I should have tested a bit further to figure out it was particularly QPathfind being weird. Sorry I stopped at the first thing I found.
 

Kot_Mart

Villager
Member
Joined
Apr 9, 2019
Messages
6
Reaction score
0
First Language
rus
Primarily Uses
RMMV
В версии MZ плагин вызывал ошибки . Смог немного его починить . Это не гарантия того что плагин будет работать без ошибок , и не конфликтовать с другими плагинами . Я не собираюсь его чинить если он будет вызывать ошибки с теми плагинами которые я не использую . Все права на плагин остаются за автором плагина .

In the MZ version, the plugin caused errors . I was able to fix it a little . This is not a guarantee that the plugin will work without errors, and will not conflict with other plugins . I'm not going to fix it if it will cause errors with those plugins that I don't use . All rights to the plugin remain with the author of the plugin .

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

//=============================================================================
/*:

 * @target MZ
 * @plugindesc v1.2.3 - With this plugin you can change the destination place sprite of the mouse\touch input.
 * <pluginName:DestinationSprite>
 * <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
 *
 *
 * @help
 * Внимание плагин перенесен кревыми лапками с версии MV на версию MZ , и может выхывать конфликт с другими плагинами .
 * 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
 */
//=============================================================================
/*  убранно из версии mz потому как не смог решить проблему с ошибкой в этой части кода
* @param Sprite Blend
 * @desc Временно  не используется Set the blend mode for the destination sprite. 0=NORMAL, 1=ADD
 * Default: 1
 * @default 1
 */
(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 = String(parameters['Sprite Figure'] || 'Square');
    var dAnimationMode = 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']);
/*    убранно из версии mz потому как не смог решить проблему с ошибкой в этой части кода   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 = 1;
        
        /*   убранно из версии mz потому как не смог решить проблему с ошибкой в этой части кода 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);

    };
})();
 

Attachments

  • DestinationSpriteMZ.js
    5.8 KB · Views: 1

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
150
Reaction score
114
First Language
Ukrainian
@Kot_Mart
You could have just ask me to port this plugin. I didn't expect anyone using it :D

- First post updated, plugin ported to MZ with the same functionality

@Kot_Mart
Ты мог просто мне написать, я бы портировал плагин. Я не знал, что его вообще кто-то использует :D

-Первый пост обновлен, плагин портирован на MZ с теми же функциями.
 

Kot_Mart

Villager
Member
Joined
Apr 9, 2019
Messages
6
Reaction score
0
First Language
rus
Primarily Uses
RMMV
Well, it has a paid counterpart with more functionality , but personally it is enough for me . A picture or circle .
Ну , ему есть платный аналог с большей функциональностью , но лично мне достаточно и его . Картинка или круг .
 

Kot_Mart

Villager
Member
Joined
Apr 9, 2019
Messages
6
Reaction score
0
First Language
rus
Primarily Uses
RMMV
@Krimer and here there is a problem, I do not know how to solve it . The problem with the transparency of the pointer . The settings specify Custom image, Fade< Opacity 255 . and the pointer still appears with transparency, or as I understand it , a filter is applied to it, I'm not sure about that .The problem persists in both the MV version and the MZ version .

@Krimer а вот тут есть проблема , низаною как решить . Проблема с прозрачностью указателя . В настройках указана Custom image , Fade< Opacity 255 . а указатель все ровно появляется с прозрачностью , или как я понимаю к нему применяется фильтр , не уверен в этом . Проблема сохраняется и в MV версии , и в MZ версии .
 

Attachments

  • DistOpaciti.gif
    DistOpaciti.gif
    168.6 KB · Views: 1
  • options.JPG
    options.JPG
    67 KB · Views: 1
  • ImageAnim.png
    ImageAnim.png
    5.9 KB · Views: 1

Kot_Mart

Villager
Member
Joined
Apr 9, 2019
Messages
6
Reaction score
0
First Language
rus
Primarily Uses
RMMV
God, how stupid .. I found what the problem is ... in my blindness, the blend parameter didn't change ...

господи , как глупо .. я нашел в чем проблема ... в моей слепоте , параметр бленд не изменил ...
 

Kot_Mart

Villager
Member
Joined
Apr 9, 2019
Messages
6
Reaction score
0
First Language
rus
Primarily Uses
RMMV
Hello again. Another improvement of this plugin is the animation of the pointer image. In total, the animation length is 20 frames, so it was easier to do, and 20 frames is more than enough for any motion pointer animation .The plugin has been tested for MV and MZ versions, and it works stably .

И снова здраствуйте. Еще одно улучшение этого плагина, анимация изображения указателя. Всего длина анимации 20 кадров, так проще было сделать, да и 20 кадров более чем достаточно для любой анимации указателя движения . Плагин проверен на MV и MZ версии , работает стабильно .
JavaScript:
//=============================================================================
// DestinationSprite.js
// Version: 1.0.1
//=============================================================================
var Imported = Imported || {};
Imported.Krimer_DestinationSprite = true;

//=============================================================================
/*:
* @plugindesc v1.0.1 - With this plugin you can change the destination place sprite of the mouse\touch input.
* <DestinationSprite>
* @author Krimer
* @target MZ
*
* @param Sprite Figure
* @desc Sprite type. It can be - Square, Circle, or Off = hide sprite. For custom image set value to - Custom. Def:Square
* @type select
* @option Square
* @option Circle
* @option Off
* @option Custom
* @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 img
* @desc Анимация курсора из картинки ( Изображение должно иметь 20 кадров ) Def:Off
* @type select
* @option Off
* @option On
* @default Off
*
* @param Animation mode
* @desc Setup animation mode. Can be: Blink => standard RMMV animation; Fade => fade sprite once per click. Def:blink
* @type select
* @option Blink
* @option Fade
* @option Off
* @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
* @type select
* @option 0
* @option 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 dAnimationimg = capitalizeFirstLetter(String(parameters['Animation img'] || 'Off')); /* Настройка анимации картинки */
    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() {
        const tileWidth = dSpriteSize || $gameMap.tileWidth();
        const tileHeight = dSpriteSize || $gameMap.tileHeight();
        this.bitmap = new Bitmap(tileWidth, tileHeight);
        this.bitmapimg = 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.bitmapimg = ImageManager.loadSystem(dCustomImage);
        }
        this.anchor.x = 0.5;
        this.anchor.y = 0.5;
        this.blendMode = dSpriteBlend;
    };


    Sprite_Destination.prototype.updateAnimation = function() {
        var tileWidth = dSpriteSize || $gameMap.tileWidth(); //для рисования картинок
        var tileHeight = dSpriteSize || $gameMap.tileHeight(); //для рисования картинок
        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);
        } else if ( dAnimationMode == "Off" ) { /* Мод аницации не выбран  */ };
        if( dSpriteFigure == 'Custom' ) { //если выбранно кастомное отображение указателя
            if (dAnimationimg== "Off") { //не анимируем по кадрам картинку
                this.bitmap.clear(); // очищаем облость битмапа
                this.bitmap.blt(this.bitmapimg,0 , 0, tileWidth, tileHeight, 0,0 , tileWidth, tileHeight); //ресуем картинку без анимации
            } else { //анимируем по кадрам картинку
                this.bitmap.clear(); // очищаем облость битмапа
                this.bitmap.blt(this.bitmapimg,tileWidth*this._frameCount , 0, tileWidth, tileHeight, 0,0 , tileWidth, tileHeight); // рисуем из загруженного битмапа нужный участок изображения
            };
        };
    };

    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);

    };
})();
 

Attachments

  • destination.png
    destination.png
    8.5 KB · Views: 2

Latest Threads

Latest Profile Posts

I've spent some cash on foley and other sound effects. I wonder sometimes if I made a poor choice, but I remember that I really want to improve the sound of my games. n...n; My frugalness haunts me sometimes.
elex 50s face.png

Experimenting with an old 50's style face set. I have done about a dozen variations of face sets for my characters, but am never happy with the results for very long. Different attempts. Second one is the same character as the first image. The third is Ivan, another character entirely.
treele.jpg
A them/they in a forest... a still for the game I'm working on.

Forum statistics

Threads
108,843
Messages
1,039,986
Members
141,306
Latest member
fmoviesfmovies2
Top