Yanfly Engine Plugin - Is it possible to Color the Text of a Skill or Magic?

Discussion in 'Javascript/Plugin Support' started by Val, Oct 2, 2016.

  1. Val

    Val Veteran Veteran

    Messages:
    276
    Likes Received:
    164
    First Language:
    Français
    Hello everyone,


    I want to know if it's possible to Color the Text of a Skill or a Magic with @Yanfly plugins engine? Do you know any idea how to do that?


    I know how to color text in message with \C[X] but this wont work with a skill or magic.


    Any idea anyone? Or maybe another plugin exist to color the text of skill or magic?


    Thanks :D
     
    #1
  2. Ahuramazda

    Ahuramazda Veteran Veteran

    Messages:
    200
    Likes Received:
    61
    Location:
    China Grove, North Carolina
    First Language:
    English
    I don't recall where this came from, but this allows you to change items/weapons/armor/skills text color and is really easy to use. (And it works with Yanfly's stuff to boot!)


    I do remember it was free to use commercially if you want, cause when I was building up a stash of useful plugins I was only getting ones with free usage saved up. Just remember to give proper credit to the original author. :)

    Code:
    //=============================================================================
    // itemColors.js
    //=============================================================================
     
    /*:
     * @plugindesc Allows you to assign items and equipment colors.
     * @author kranasAngel
     *
     *
     * @help Changes the Item's color based on the notetag  
     * <itemColor:x> 
     * Where x is the color code that you want. 
     * To find Rpg maker color codes, search rpg maker color codes, or something similar.
     *
     *
     *
     *
    */
     
    (function(){
     
    Window_Base.prototype.drawItemName = function(item, x, y, width) {width = width || 312; if (item) {
    	var iconBoxWidth = Window_Base._iconWidth + 4;
    	this.resetTextColor();
    	this.drawIcon(item.iconIndex, x + 2, y + 2);
    	if (typeof item.meta.itemColor !== "undefined"){
    		var element = parseInt(item.meta.itemColor);
    		this.changeTextColor(this.textColor(element)) 
    		console.log("item Color" + element);
    		};
    	this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
    	this.resetTextColor();
    	};
    	};
    })();
     
    #2
    Val likes this.
  3. Val

    Val Veteran Veteran

    Messages:
    276
    Likes Received:
    164
    First Language:
    Français
    Thanks a lot this will be a nice touch to my project :D
     
    #3
    Ahuramazda likes this.
  4. renan_joly007

    renan_joly007 Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    Português
    Primarily Uses:
    RMMV
    Image Layont.png?
     
    #4

Share This Page