Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Issues with Ruby Gosu Image#subimage
- - By kyonides Date 2018-04-07 01:35
So far I was glad with the option of reusing pictures by caching them. The only thing I disliked was the very same need to cache them :P

Sadly that has changed since I tried to make a new composite sprite class that kept an image that looks like a gauge, some sort of bar. As a single bar in a menu it worked quite fine, but that was not the case when I tried to use more than one of the same kind. While trying to draw three of them, only the first one got drawn as expected. I thought they shared the same x coordinate but they didn't!! What did I use to tile it? The Image#subimage method because the tiles have different dimensions. I suspected I should not cache that picture since you cannot dup Gosu::Images, so I preferred to skip the caching part and load it from file every single time I need to update it... to no avail, guys!! Gosu keeps ignoring them,even after I confirmed they do so exist! Honestly, I don't think it could be my fault and I do need some serious help here... :S

You can find the CompositePictureSprite or SpriteCompositePicture class in my KUnits Gosu demo on the corresponding subforum.
Parent - - By lol_o2 Date 2018-04-07 13:37
Um, could you include music download for your game? >_>
Can't run it without this.
Parent - - By kyonides Date 2018-04-07 17:22
You can easily fix that yourself, in lib/setup folder you'll find all the modules that are used to configure my scenes or states scripts. There they usually begin with a BGM constant... but if you wanna test it with the multiple gauges on screen (OK, just one being displayed while the others are missing), you better wait till I upload the most recent version of my project.

I know, it looks more like a concept than an actual game, even if it exceeded 8000 lines of code already... :S

By the way, you gotta talk to the dark elf lady on the first map to open the pseudo battle screen. :P
Parent - - By lol_o2 Date 2018-04-08 10:42
Why did you split everything into few archives? :/
Game complains about "images/pictures/gauge0.png". It doesn't exist and I can't start a battle.
Parent - By kyonides Date 2018-04-08 19:13
O.o but it does exist, it's the same as gauge1 and gauge2... Let me check the resources compressed file I uploaded, but you can use any other image as a gauge and go through the same nasty situation as I did :/
Parent - - By lol_o2 Date 2018-04-11 19:31
So, what exactly is your problem here? I checked the game and gauges look fine. You updated them all at once so obviously they have the same length. Caching has nothing to do with subimage, because it would be waste of memory (although it's possible it doesn't even allocate new texture).
Parent - - By kyonides Date 2018-04-12 03:23
I was using two images as gauge components, that did not work at all. Using a single image seems to work fine, but there is no good reason why neither subimage nor dup would work as expected.
Parent - - By jlnr (dev) Date 2018-04-16 22:33
I try to reply to bug reports ASAP but I really need an example that demonstrates the issue. Now that you have updated the game before I had the free time to download it, I still don't understand what the issue with subimage was :/

Putting your game on GitHub makes it easier to refer to previous revisions. You can also always download a ZIP of the current master version (or link to that ZIP from other sites), instead of having several RAR files in MediaFire. I really recommend it (plus: knowing Git/GitHub is a valuable skill :)).
Parent - By kyonides Date 2018-04-17 00:01
Well, I also use mega, but I know, github might help. The thing is I never got used to github :P

The issue was that it subimage does not let you create composite images, like tiles that have different sizes. If you try to use it to draw them during gameplay, it fails to show you anything...
Up Topic Gosu / Gosu Exchange / Issues with Ruby Gosu Image#subimage

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill