Xyphien Forums

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Changing the MOG_ChronoEngine.js Default Font to SFont

I am currently using MOGHUNTER’s Chrono Engine ABS plugin in my project, as well as Victor Engine’s SFont plugin.

But, as displayed in the screen capture below, the Chrono Engine seems to still be using RPG Maker MV’s default font.




In the last paragraph of Victor Engine’s SFont Help text, he mentions:

Code:
To add SFonts on non-window objects that uses the drawText, you have to add it manually (requires some scripting knowledge). You need to call bitmap.changeSFont(index). The index must be one of the values you setup on the plugin parameters and the bitmap must be a valid bitmap object.
The only thing I understand from this is, based on my VE_SFont.js parameters, the call would be:

Code:
bitmap.changeSFont(0)


But I am still not sure where in MOG_ChronoEngine.js I would place this.

A combing of Google yielded a discussion on the rpgmakerweb.com forums (from 2017), where a user named Sixth shed a little more insight on the matter:

Code:
It is actually very easy to change the draw methods in every script.  If something is using the default draw method for texts, that will use either the draw_text or draw_text_ex method.  The only thing you need to do is to search for these methods in your custom scripts and replace them with the drawing method from Victor's script.  You have to set the correct argument values at the correct argument positions, but aside from that, it is not much of a hassle to do.
They were discussing Victor Engine’s SFont plugin for RPG Maker VX ACE, but I thought I might look into it anyway. So I went into the MOG_ChronoEngine.js file and searched for all instances of “drawText” (without the “_”, since this is JavaScript).

I came up with the following results:

Lines 7254-7260:
Code:
//==============================
// * refresh Name
//==============================
ToolCursor.prototype.refreshName = function(target) {
this._name.bitmap.clear();
this._name.bitmap.drawText(target.battler().name(),0,0,200,48,"center")
};
Lines 8926-8941:
Code:
//==============================
// * draw Item Number
//==============================
Window_ToolSkill.prototype.drawItemNumber = function(item, x, y, width) {
    if (item.tool.itemCost) {
var itemCost = $dataItems[item.tool.itemCost];
if (itemCost) {
   this.drawText(':', x, y, width - this.textWidth('00'), 'right');
            this.drawText($gameParty.numItems(itemCost), x, y, width, 'right');
};
} else if (item.tool.mpCost > 0) {
            this.drawText(TextManager.mpA + ' '  + item.tool.mpCost, x, y, width, 'right');
} else if (item.tool.tpCost > 0) {
            this.drawText(TextManager.tpA + ' '  + item.tool.tpCost, x, y, width, 'right');
    };
};
Lines 9183-9198:
Code:
//==============================
// * draw Item Number
//==============================
Window_ToolList.prototype.drawItemNumber = function(item, x, y, width) {
    if (item.tool.itemCost) {
var itemCost = $dataItems[item.tool.itemCost];
if (itemCost) {
   this.drawText(':', x, y, width - this.textWidth('00'), 'right');
            this.drawText($gameParty.numItems(itemCost), x, y, width, 'right');
};
} else if (item.tool.mpCost > 0) {
            this.drawText(TextManager.mpA + ' '  + item.tool.mpCost, x, y, width, 'right');
} else if (item.tool.tpCost > 0) {
            this.drawText(TextManager.tpA + ' '  + item.tool.tpCost, x, y, width, 'right');
    };
};
Lines 11093-11108:
Code:
//==============================
// * refresh Result CR
//==============================
Spriteset_Map.prototype.refreshResultCR = function() {
$gameTemp._chrono.victory[1] = false;
this._resultCR.opacity = 0;
this._resultCRExp.opacity = 0;
this._resultCRGold.opacity = 0;
this._resultCR.x = this._resultCR.org[0] - 50;
this._resultCRExp.bitmap.clear();
this._resultCRGold.bitmap.clear()
var text = $gameTemp._chrono.exp;
this._resultCRExp.bitmap.drawText(text,0,0,190,32,"center");
var text = $gameTemp._chrono.gold;
this._resultCRGold.bitmap.drawText(text,0,0,190,32,"center");
};

I looked in VE_SFont.js to see if I could deduce the “drawing method” that Sixth mentioned, but was not able to do so.

Based on this information, does anybody know how I can go about changing the default font that MOG_ChronoEngine.js uses?

Thanks in advance!
 
Top