How can I learn JS for RM better? I know some of it and created four plugins you can download for free (see my signature.) But I still struggle with this language. JS is such a weird language. I am more comfortable with C++ (which I know relatively little), especially Java and C# (I know these two languages relatively well and have much experience with them.) Here are some issues I run into:
-The language is weird. The RMMV Plugin Manager accepts booleans as only true or false and numbers as numbers, with or without a decimal. But in the plugin, they are treated as strings. At least I know this part and can convert the strings, but other parts of RM JS are weird, and I don't know them.
-I frequently struggle with some things in this RM framework. For instance, I have tried drawing a custom drawing, created a Window class, and instantiated it. I have tried creating my drawIcon() to draw my thing, but it didn't work. However, after struggling and trying out some things, I have made this code that works:
I just got lucky that you can initialize the window's contents with an assignment operator (the "=") (because the drawIcon method uses this.contents.blt() method rather than this one). But then there was another problem. I have created a refresh function in this Window class of mine, and I have used "this.contents.clear()," but it just didn't work. I never received an error, either. I needed to clear the icon but nothing. Then, through thinking and experimenting after much struggle, I tried setting the contents null like this "this.contents = null," and it has worked! How can I learn such "weird" parts of this framework (RMMV framework)? Maybe this is more than just luck, but it still isn't easy for me to do so. This was for my newest plugin, Press Turn Battle System for RMMV.
Edit: I've learned a "decent amount" from a tutor. I learn well from a good book or an instructor.
-The language is weird. The RMMV Plugin Manager accepts booleans as only true or false and numbers as numbers, with or without a decimal. But in the plugin, they are treated as strings. At least I know this part and can convert the strings, but other parts of RM JS are weird, and I don't know them.
-I frequently struggle with some things in this RM framework. For instance, I have tried drawing a custom drawing, created a Window class, and instantiated it. I have tried creating my drawIcon() to draw my thing, but it didn't work. However, after struggling and trying out some things, I have made this code that works:
JavaScript:
Windows_Turn_Icon.prototype.drawTurnIcon1 = function () {
let mySprite = ImageManager.loadSystem('turn_icon_1');
this.contents = mySprite;
}
I just got lucky that you can initialize the window's contents with an assignment operator (the "=") (because the drawIcon method uses this.contents.blt() method rather than this one). But then there was another problem. I have created a refresh function in this Window class of mine, and I have used "this.contents.clear()," but it just didn't work. I never received an error, either. I needed to clear the icon but nothing. Then, through thinking and experimenting after much struggle, I tried setting the contents null like this "this.contents = null," and it has worked! How can I learn such "weird" parts of this framework (RMMV framework)? Maybe this is more than just luck, but it still isn't easy for me to do so. This was for my newest plugin, Press Turn Battle System for RMMV.
Edit: I've learned a "decent amount" from a tutor. I learn well from a good book or an instructor.