Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Imported = Imported || {};
- Imported.Coolie_ImageToggleSmoothing = true;
- var Coolie = Coolie || {};
- Coolie.ITS = Coolie.ITS || {};
- Coolie.ITS.version = 1.00;
- /*:
- * @plugindesc v1.00 Enables toggling of MV's default smoothing effect on images via a filename string
- * @author Coolie (William Couillard)
- *
- * @param String Settings
- * @param System Image Settings
- *
- * @param String
- * @parent String Settings
- * @desc Adding this string anywhere in an image's filename will enable smoothing. Any image except /img/system/ files.
- * @default _!smooth
- *
- * @param System Image Smoothing?
- * @parent System Image Settings
- * @type boolean
- * @yes true
- * @no false
- * @desc ON: Smoothing applied to all /img/system/ files.
- * OFF: Smoothing disabled to all /img/system/ files.
- * @default true
- *
- * @help
- * -----------------------------------------------------------------------------
- * ABOUT THIS PLUGIN
- * -----------------------------------------------------------------------------
- * Images in RPG Maker MV have smoothing on by default. This means when the
- * image is shown in-game, it will blur as the scale of the image changes. This
- * helps to make images look better when they are scaled up or down in size on
- * the screen, but it doesn't mean you ALWAYS want that effect on every image.
- *
- * If you are making a pixelated game, for example, you might want the smoothing
- * turned off for certain images. This plugin lets you set a string for your
- * image FILENAMES (NOT the "name" or "id" in the MV editor) to turn smoothing
- * ON, and any FILENAMES without this string will not have smoothing!
- *
- * By default, this plugin disables the smoothing effect on all images in your
- * game, but by adding a string to an image filename, we can restore the effect
- * so you can choose which images have it, and which ones do not.
- *
- * The string you will have to add to your filenames is set in the parameters.
- * Simply rename the files you with to keep smoothing for with your chosen
- * string somewhere in the filename.
- *
- * Let's take the default MV animation file, Hit1, as an example.
- *
- * If we rename that file to "Hit1_!smooth" with this plugin's default setting,
- * then that image will now have the default smoothing effect whenever it is
- * used in your game.
- *
- * If we leave it as just "Hit1" with this plugin, it will no longer have the
- * smoothing effect. Any occurence of the string will result in the image
- * having the smoothing effect enabled.
- *
- * Just to be clear on the usage, you'll need to add the plugin, choose a
- * string, then add that string to the filename of any image you wish to keep
- * smoothing effects for. The string can be anywhere in the filename, like so:
- *
- * Filename: Hit1 : image will not have smoothing effect
- * Filename: Hit1_!smooth : image will have smoothing effect
- * Filename: _!smoothHit1 : image will have smoothing effect
- * Filename: Hit_!smooth1 : image will have smoothing effect
- *
- * This can be done using one string on the filename of almost ANY image you
- * have in your game! System images were intentionally left out, as they are
- * very name-dependent files that would no longer work properly if you change
- * their name(s). Due to this, I have added the option to either smooth or not
- * smooth the entire img/system/ folder. It retains smoothing by default.
- *
- * The images contained in the following folders can have your string added
- * to enable smoothing:
- *
- * img/animations/
- * img/battlebacks1/
- * img/battlebacks2/
- * img/characters/
- * img/enemies/
- * img/faces/
- * img/parallaxes/
- * img/pictures/
- * img/sv_actors/
- * img/sv_enemies/
- * img/tilesets/
- * img/titles1/
- * img/titles2/
- *
- * A lot of ImageManager default functions are replaced by this plugin, so there
- * is still a chance that any other plugin that alters these functions will be
- * incompatible. However, most plugins don't mess with these functions. Still,
- * you should place it low on the list of plugins in your game.
- *
- * I will do my best to update this for compatibility.
- *
- * -----------------------------------------------------------------------------
- * TIPS
- * -----------------------------------------------------------------------------
- * If you'd like to have an image that sometimes has the smoothing effect and
- * sometimes does not, you can simply make a copy of the image in your folder
- * and keep one with its original filename and one with the string added.
- *
- * Then you can simply call the appropriate image file when needed.
- *
- * -----------------------------------------------------------------------------
- * TERMS OF USE
- * -----------------------------------------------------------------------------
- * It is OK to use this plugin in both commercial and non-commercial
- * projects.
- *
- * Credit is appreciated, but not required.
- *
- * -----------------------------------------------------------------------------
- * VERSION & UPDATE HISTORY
- * -----------------------------------------------------------------------------
- * > v1.00 : Initial Release
- * > March 11th, 2023
- * -----------------------------------------------------------------------------
- */
- Coolie.Parameters = PluginManager.parameters('Coolie_ImageToggleSmoothing');
- Coolie.Param = Coolie.Param || {};
- Coolie.Param.SmoothingString = String(Coolie.Parameters['String']);
- Coolie.Param.SmoothingSystem = String(Coolie.Parameters['System Image Smoothing?']);
- var smoothingString = Coolie.Param.SmoothingString;
- var smoothingSystem = Coolie.Param.SmoothingSystem;
- // Load
- ImageManager.loadAnimation = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/animations/', filename, hue, true);
- } else {
- return this.loadBitmap('img/animations/', filename, hue, false);
- }
- };
- ImageManager.loadBattleback1 = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/battlebacks1/', filename, hue, true);
- } else {
- return this.loadBitmap('img/battlebacks1/', filename, hue, false);
- }
- };
- ImageManager.loadBattleback2 = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/battlebacks2/', filename, hue, true);
- } else {
- return this.loadBitmap('img/battlebacks2/', filename, hue, false);
- }
- };
- ImageManager.loadEnemy = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/enemies/', filename, hue, true);
- } else {
- return this.loadBitmap('img/enemies/', filename, hue, false);
- }
- };
- ImageManager.loadCharacter = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/characters/', filename, hue, true);
- } else {
- return this.loadBitmap('img/characters/', filename, hue, false);
- }
- };
- ImageManager.loadFace = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/faces/', filename, hue, true);
- } else {
- return this.loadBitmap('img/faces/', filename, hue, false);
- }
- };
- ImageManager.loadParallax = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/parallaxes/', filename, hue, true);
- } else {
- return this.loadBitmap('img/parallaxes/', filename, hue, false);
- }
- };
- ImageManager.loadPicture = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/pictures/', filename, hue, true);
- } else {
- return this.loadBitmap('img/pictures/', filename, hue, false);
- }
- };
- ImageManager.loadSvActor = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/sv_actors/', filename, hue, true);
- } else {
- return this.loadBitmap('img/sv_actors/', filename, hue, false);
- }
- };
- ImageManager.loadSvEnemy = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/sv_enemies/', filename, hue, true);
- } else {
- return this.loadBitmap('img/sv_enemies/', filename, hue, false);
- }
- };
- ImageManager.loadTileset = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/tilesets/', filename, hue, true);
- } else {
- return this.loadBitmap('img/tilesets/', filename, hue, false);
- }
- };
- ImageManager.loadTitle1 = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/titles1/', filename, hue, true);
- } else {
- return this.loadBitmap('img/titles1/', filename, hue, false);
- }
- };
- ImageManager.loadTitle2 = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.loadBitmap('img/titles2/', filename, hue, true);
- } else {
- return this.loadBitmap('img/titles2/', filename, hue, false);
- }
- };
- // Reserve
- ImageManager.reserveAnimation = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/animations/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/animations/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveBattleback1 = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/battlebacks1/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/battlebacks1/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveBattleback2 = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/battlebacks2/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/battlebacks2/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveEnemy = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/enemies/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/enemies/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveCharacter = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/characters/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/characters/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveFace = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/faces/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/faces/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveParallax = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/parallaxes/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/parallaxes/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reservePicture = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/pictures/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/pictures/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveSvActor = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/sv_actors/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/sv_actors/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveSvEnemy = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/sv_enemies/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/sv_enemies/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveTileset = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/tilesets/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/tilesets/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveTitle1 = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/titles1/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/titles1/', filename, hue, false, reservationId);
- }
- };
- ImageManager.reserveTitle2 = function(filename, hue, reservationId) {
- if (filename.contains(smoothingString)) {
- return this.reserveBitmap('img/titles2/', filename, hue, true, reservationId);
- } else {
- return this.reserveBitmap('img/titles2/', filename, hue, false, reservationId);
- }
- };
- // Request
- ImageManager.requestAnimation = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/animations/', filename, hue, true);
- } else {
- return this.requestBitmap('img/animations/', filename, hue, false);
- }
- };
- ImageManager.requestBattleback1 = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/battlebacks1/', filename, hue, true);
- } else {
- return this.requestBitmap('img/battlebacks1/', filename, hue, false);
- }
- };
- ImageManager.requestBattleback2 = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/battlebacks2/', filename, hue, true);
- } else {
- return this.requestBitmap('img/battlebacks2/', filename, hue, false);
- }
- };
- ImageManager.requestEnemy = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/enemies/', filename, hue, true);
- } else {
- return this.requestBitmap('img/enemies/', filename, hue, false);
- }
- };
- ImageManager.requestCharacter = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/characters/', filename, hue, true);
- } else {
- return this.requestBitmap('img/characters/', filename, hue, false);
- }
- };
- ImageManager.requestFace = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/faces/', filename, hue, true);
- } else {
- return this.requestBitmap('img/faces/', filename, hue, false);
- }
- };
- ImageManager.requestParallax = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/parallaxes/', filename, hue, true);
- } else {
- return this.requestBitmap('img/parallaxes/', filename, hue, false);
- }
- };
- ImageManager.requestPicture = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/pictures/', filename, hue, true);
- } else {
- return this.requestBitmap('img/pictures/', filename, hue, false);
- }
- };
- ImageManager.requestSvActor = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/sv_actors/', filename, hue, true);
- } else {
- return this.requestBitmap('img/sv_actors/', filename, hue, false);
- }
- };
- ImageManager.requestSvEnemy = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/sv_enemies/', filename, hue, true);
- } else {
- return this.requestBitmap('img/sv_enemies/', filename, hue, false);
- }
- };
- ImageManager.requestTileset = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/tilesets/', filename, hue, true);
- } else {
- return this.requestBitmap('img/tilesets/', filename, hue, false);
- }
- };
- ImageManager.requestTitle1 = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/titles1/', filename, hue, true);
- } else {
- return this.requestBitmap('img/titles1/', filename, hue, false);
- }
- };
- ImageManager.requestTitle2 = function(filename, hue) {
- if (filename.contains(smoothingString)) {
- return this.requestBitmap('img/titles2/', filename, hue, true);
- } else {
- return this.requestBitmap('img/titles2/', filename, hue, false);
- }
- };
- // System
- ImageManager.loadSystem = function(filename, hue) {
- if (smoothingSystem) {
- return this.loadBitmap('img/system/', filename, hue, true);
- } else {
- return this.loadBitmap('img/system/', filename, hue, false);
- }
- };
- ImageManager.reserveSystem = function(filename, hue, reservationId) {
- if (smoothingSystem) {
- return this.reserveBitmap('img/system/', filename, hue, true, reservationId || this._systemReservationId);
- } else {
- return this.reserveBitmap('img/system/', filename, hue, false, reservationId || this._systemReservationId);
- }
- };
- ImageManager.requestSystem = function(filename, hue) {
- if (smoothingSystem) {
- return this.requestBitmap('img/system/', filename, hue, true);
- } else {
- return this.requestBitmap('img/system/', filename, hue, false);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement