- Joined
- Mar 28, 2016
- Messages
- 1,623
- Reaction score
- 1,440
- First Language
- French
- Primarily Uses
- RMMV
hi am trying add a global prototype to all my object.
ex:
if I create some new object in $Gamevariable. for fun
now i have all my object with specifique proprety and method in
Now I would like add a global prototype, for all those objects
example this methods
how i can add this method for make example this call operational
i try add this prototype
ist work only if i call
but no if i call
Why ?
Tell me if I'm not clear
thanks a lot to help me more understand js
ex:
if I create some new object in $Gamevariable. for fun
Code:
var NewPid = 20;
$gameVariables.Hud_PinBoard = new Hud_PinBoard(NewPid);
var NewPid = Preload_Hud_PinBoard(); // return the new PID
$gameVariables.Hud_Displacement= new Hud_Displacement(NewPid);
var NewPid = Preload_Hud_Displacement(); // return the new PID
$gameVariables.Hud_Info= new Hud_Info(NewPid);
var NewPid = Preload_Hud_Info(); // return the new PID
Code:
$gameVariables.Hud_PinBoard
$gameVariables.Hud_Displacement
$gameVariables.Hud_Info
Now I would like add a global prototype, for all those objects
example this methods
Code:
function A(a, b,c) {
this.XY = [a,b,c];
}
Code:
$gameVariables.Hud_PinBoard.A(a,b,c); // change the proprety this.XY in the object Hud_PinBoard
$gameVariables.Hud_Info.A(a,b,c); // change the proprety this.XY in the object Hud_Info
Code:
Game_Variables.prototype.A = function A(a, b,c) {
this.XY = [a,b,c];
}
Code:
$gameVariables.A()
Code:
$gameVariables.Hud_Displacement.A(); // return undefined
Tell me if I'm not clear
thanks a lot to help me more understand js
Last edited:
