Destination Sprite

● ARCHIVED · READ-ONLY
Started by Krimer 38 posts Page 2 of 2 View original ↗
  1. 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.
  2. Kathryne Knette said:
    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 :)
  3. 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 :/
  4. @Kathryne Knette
    I think i see the problem, but it's not QMovement it self, it's combination with QPathfind

    Added new version, try it
  5. 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.
  6. В версии 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);
    
        };
    })();
  7. @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

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

    -Первый пост обновлен, плагин портирован на MZ с теми же функциями.
  8. Well, it has a paid counterpart with more functionality , but personally it is enough for me . A picture or circle .
    rus
    Ну , ему есть платный аналог с большей функциональностью , но лично мне достаточно и его . Картинка или круг .
  9. @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 версии .
  10. God, how stupid .. I found what the problem is ... in my blindness, the blend parameter didn't change ...

    господи , как глупо .. я нашел в чем проблема ... в моей слепоте , параметр бленд не изменил ...
  11. 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 версии , работает стабильно .
    code
    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);
    
        };
    })();
  12. Amazing! Thanks!
  13. Works great, thank you very much ^^
  14. I am currently using this plug in. When I start the game the custom destination sprite shows up when I click around. As soon as I transfer to another map it disapears. I only have a few other plugins that are running with this at the same time so I am not sure what could be causing that to happen. Once its gone it doesnt come back. Not sure what is going on. Anyone else have this issue?
  15. phantom87 said:
    I am currently using this plug in. When I start the game the custom destination sprite shows up when I click around. As soon as I transfer to another map it disapears. I only have a few other plugins that are running with this at the same time so I am not sure what could be causing that to happen. Once its gone it doesnt come back. Not sure what is going on. Anyone else have this issue?

    Me too! Don't know how to fix yet...
  16. This worked perfectly for what I needed! Thank you so much!
    I'm making a game that's not really a game but more of a clickable item tracker, so I needed a way to hide the pointer completely. Making the opacity set to 0 did exactly what I needed :rhappy:
  17. Plugin Update:
    • Now a single plugin that works for both MZ and MV.
    • Fixed a bug where the custom destination sprite would disappear after transferring to another map (this bug previously appeared only in MZ).
    • Expanded functionality - the plugin now supports spritesheets.
  18. Thank you so much! This is just what I needed, man, I hate the default square!
    Thank you!