Firstly, I must admit that I'm still learning as a coder. That's why your feedback are worth as much as my growth.
Plugin Description
REWRITE pictures function for EASING experience and user CONVENIENCE.
It is a useful plugin for visual novel esque or could be much more!
Plugin Features
Screenshot
Meanwhile, the content of the event shown on the GIF :
Script
Future Update
Depend on feedback, but I can only do much.
For the last, let me know if there's something you don't understand or what would you like to suggest to improve this plugin I made.
Thank you ~
Plugin Description
REWRITE pictures function for EASING experience and user CONVENIENCE.
It is a useful plugin for visual novel esque or could be much more!
Plugin Features
- Easing Execution
- Show picture by default will show up instantly like BAM. Normally to avoid that you have to show the picture with 0 opacity then later use move picture to create fade in effect. With this plugin, that TWO STEP will be CONVENIENTLY made into ONE STEP. Show picture will always have FADE IN effect without the need of using move picture.
- Erase picture by default will instantly erase the picture like BAM. Again, to avoid that you have to use move picture first before erase picture to create fade out effect. With this plugin, that TWO STEP will be CONVENIENTLY made into ONE STEP. Erase picture will always have FADE OUT effect without the need of using move picture.
- Move picture by default move your picture in linear like robot. With this plugin, every picture movement will move sharply first while gradually slowed down to target, creating smooth effect.
- Convenient Percentage Coordinate
User will no longer need to worry doing the math when inputting the X and Y coordinate. User also no longer need to worry their pictures messed up when changing game resolution. This plugin treat the X and Y constant value as percentage (0%-100%) value. By default, you have to learn what your game resolution first before using pictures. When your game resolution is 816x624, to show a picture at the center you have to put direct designation value of (408, 312) which I bet rarely people doing that because they dislike doing math. This pisses me of because lots of people missing the potential from that laziness. But with this plugin, everything will be convenient. No matter what your resolution is, (50, 50) will always be mid-center. (100, 50) will always be right-center. (100, 100) will always be bottom-right corner.
- Actual Rotate Picture
By default "rotate picture" will indefinitely spin your picture like an unstopable fidget spinner. Nobody report this because rarely people even use this feature. This plugin allows you to actually "rotate" your picture by constant degree. Now rotate picture : 30 will rotate the picture to 30 degree. NOT spin the picture with 30 speed. (Seriously, who need that?)
Screenshot
Meanwhile, the content of the event shown on the GIF :
Script
JavaScript:
/*:
* @plugindesc Rewrite pictures function by sacrificing accuracy and potential for smooth execution and user convenience.
* @author Kuro DCupu
*
* @help Pictures Alternative v1.0
===================================
Released date : 01/04/2020
- Show Picture gradually fade in the picture
- Move Picture gradually slowed down the picture
- Erase Picture gradually fade out the picture
- Rotate Picture "rotate" instead of "spin"
- Input X and Y coordinate treated as screen size percentage instead of constant pixel value
*/
Speed = 20;
GridX = 100;
GridY = 100;
Game_Picture_show = Game_Picture.prototype.show;
Game_Picture_move = Game_Picture.prototype.move;
Game_Picture.prototype.show = function(name, origin, x, y, scaleX, scaleY, opacity, blendMode) {
Game_Picture_show.call(this, name, origin, x, y, scaleX, scaleY, opacity, blendMode);
this._x = x * Graphics.width / GridX;
this._y = y * Graphics.height / GridY;
this._opacity = 0;
this.move(origin, x, y, scaleX, scaleY, opacity, blendMode, Speed);
};
Game_Picture.prototype.move = function(origin, x, y, scaleX, scaleY, opacity, blendMode, duration) {
Game_Picture_move.call(this, origin, x, y, scaleX, scaleY, opacity, blendMode, duration);
this._targetX = x * Graphics.width / GridX;
this._targetY = y * Graphics.height / GridY;
this._duration = Speed;
};
Game_Picture.prototype.updateMove = function() {
var d = this._duration;
this._x = (this._x * (d - 1) + this._targetX) / d;
this._y = (this._y * (d - 1) + this._targetY) / d;
this._scaleX = (this._scaleX * (d - 1) + this._targetScaleX) / d;
this._scaleY = (this._scaleY * (d - 1) + this._targetScaleY) / d;
this._opacity = (this._opacity * (d - 1) + this._targetOpacity) / d;
};
Game_Picture.prototype.erase = function() {
Game_Picture_move.call(this, this._origin, this._x, this._y, this._scaleX, this._scaleY, 0, this._blendMode, Speed);
};
Game_Screen.prototype.erasePicture = function(pictureId) {
var picture = this.picture(pictureId);
if (picture) {
picture.erase();
}
};
Game_Picture.prototype.initRotation = function() {
this._angle = 0;
this._rotationSpeed = 0;
};
Game_Picture.prototype.rotate = function(speed) {
this._rotationSpeed += speed;
};
Game_Picture.prototype.updateRotation = function() {
this._angle = (this._angle * (Speed - 1) + this._rotationSpeed) / Speed;
};
Future Update
Depend on feedback, but I can only do much.
For the last, let me know if there's something you don't understand or what would you like to suggest to improve this plugin I made.
Thank you ~