08-28-2020, 04:57 AM
Gosu::Image's vs Sprite's
Any RPG Maker user gotta know by know what the Sprite class is. This basic class might also appear under a similar name on other game engines. As far as you know its a Hidden Class for a quite obvious reason: Ruby doesn't include any visuals by default. That makes you depend on third party libraries or your very own custom library. That also means they might be written in a different programming language like C or C++ or perhaps even C#.
In Gosu and my library directly based on it, we get the Gosu::Image class that's a mix between your typical Bitmap and Sprite classes.
Yeap, it handles both components at the same time. You'd might think it's a Sprite class, but it does get some access to its ImageData class data that might be considered its very own Bitmap object.
What happens if I depend on the default Gosu::Image class?
Well, it's not like anything should happen BUT you gotta remember there are 2 or 3 special steps you gotta add to your list of pending script calls once you've created your images alias sprites.
- There's a draw step!
This means you gotta add your image to the list of drawables manually. Impossible in RM series!
- Your image needs you to pass some coordinates and optionally some x and y scale factors, a color and something dubbed the alpha mode.
- Disposal of images is automatic. So you don't really need to do it yourself, Ruby or C++ should handle that for you.
Which option do you prefer?
To pass any of those Drawing Arguments?
Or handle it a la RM where they're predefined?
If you choose the latter, you gotta know you'd still need to add a line of code telling the scene's draw method to actually draw it on screen... but you wouldn't need to pass any parameters.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE