So, I tested it in one of my more complicated projects, and I noticed a few issues.
Bug 1:
Spoiler
The wave effect of sprites refuses to work unless the wave_length property of the sprite is set explicitly.
Seems like the default value of wave_length property is not setup correctly in RGD?
In case you wonder, if that property is not set and the wave_amp property is set to something higher than 0, the sprite will disappear completely, or will end up being a big pile of lines with RGD. In the default engine, it would simply load 180 for wave_length if it's not set.
I could specify wave_length everywhere if I need to, but given that I would need to edit an animation configuration section of 5000+ lines in more than one project, I would rather you add that default wave_length value back if possible. *.*
On the bright side, the wave effect seems to be much smoother with RGD, or at least I think so.
Bug 2:
Spoiler
The
eql? method is messed up for
Color objects.
The method itself works if called on any other object type, but when called on a
Color object, it triggers an error IF the other object is NOT a
Color object.
For example, I can do this:
But I can't do this:
It seems like it misses the part where it should return
false if the other object is not the same (
Color) object, because it wants to convert the other object to a
Color object (and compare it after, I guess), and that obviously won't work.
Bug 3:
Spoiler
There seems to be an issue with moved viewports and how the sprites on that viewport are displayed.
I use a lot of viewports in my more complicated menus. I don't use them because of their Z value, that is irrelevant to me (in most cases), I use them to make a specific area on the screen display a specific group of sprites, and I need these sprites to disappear when they get out of the boundaries of their viewport (or get cut down if some parts are still in the boundaries).
With RGD installed, viewports just refuse to work like this. Stationary viewports are fine, but when I move them around, problems start to occur.
I move these viewports around using their rect property.
I also move the sprites on these viewports outside of the viewport's rect to hide them. This works so far, so the sprites are hidden, as they should be, since they are outside of the viewport's rect.
Here comes the issue... When I move the viewport now (changing the rect's x property), the viewport moves fine, but the sprites it holds will appear the moment the viewport's rect doesn't cover them anymore. Ahh, kinda hard to explain without proper visuals, so I tried to demonstrate this in the images below.
Spoiler
When the animation starts for that filter display, the sprites on it will move to the left and right and they will get out of the viewport's rect, so they will get hidden.Like this:
During halfway, the viewport itself will start to move to the left as well, and will get out of the screen completely too.
This results in a pretty cool animation... Until it reaches the end, that is, because this happens:
See those leftover sprites at the left? They should not be shown at all, yet when their viewport moves enough to the left, they will appear for some reason.
It is the same with all viewports and their assigned sprites, and it happens only when I move the viewport to the left, and only the sprites on the right will show up.
I hope this issue gets fixed soon, because moving viewports around is kinda necessary for many of the menus I made.
Bug 4:
Spoiler
There happens to be some color issues with the sprite's
color property.
The issue occurs in the same menu I have shown above, but just for clarification, this is how it should look like:
When at least 1 card from a type is equipped, their command background should turn to green, and when no card is equipped from a type, their background should revert to normal color (gray in this case).
If it matters, the green value of the color is always set to 255, I only change the alpha value of them after equipping/unequipping a card.
Now, with RGD installed, this happens:
Spoiler
And if I unequip all cards from a type, this happens:
So, whatever color I set the last, ALL of them will get the same color, regardless if they are equipped or not.
I don't even know how to debug this, since I have no idea how can this even happen.
If it matters, those background sprites are using the same bitmap, but each of them is a clone of the original, so they should be handled separately.
No idea if the sprite's bitmap is connected to the sprite's color property or not, but just in case it matters, they are all cloned bitmaps using the same image.
Bug 5:
Spoiler
Well, just look at the font on the above images...
The first image shown in Bug 4 is using the correct display for the font, that one is taken without RGD installed.
The rest of them are all screenshots made with the RGD. The difference in the font is kinda obvious.
If it matters, here are the font settings I use for those:
Spoiler
Code:
:font => {
:type => "Matrix Bold", :size => 16,
:bold => false, :italic => false, :shadow => true, :outline => true,
:font_col => Color.new(255,255,255,255),
:outline_col => Color.new(0, 0, 0, 128),
},
Also, there are some symbols which won't load with RGD installed, such as the arrows like: ↑ and ↓, for example. These load without any issue normally (so long as the font type supports them), but with RGD installed, they will show up as big squares instead.
I don't plan to use the default font drawing method for my next menu engine (using my own which uses images instead with many extra options), but it still comes in handy for quick testing the text space during early designs, so a fix would be highly appreciated.
These are the bugs I found so far. I made the project I tested in for a commission, so I can't share it, but if you need a video of how it should work properly, here is one I uploaded when I finished the project:
Yes, I slowed down the music, annoying, I know!
😀
Anyway, hope you can fix these bugs, because as it stands now, I can't make many visual effects I want to make. *.*
I will test the RGD in some other projects later if I find some free time. Who knows what else will I find, right?
😀
Edit:
Okay, so I fixed bug #2 and bug #4.
Bug 2 fix:
Spoiler
Code:
class Color
alias fix_eql9917 eql?
def eql?(other)
return false unless self.class == other.class
return fix_eql9917(other)
end
end
This will take care of the crash issue on
Color objects when comparing them with objects with different classes.
Adding it in RGD is preferred still, but until that happens, this fix works.
Bug 4 fix:
Spoiler
Code:
class Sprite
def color=(val)
self.color.red = val.red
self.color.green = val.green
self.color.blue = val.blue
self.color.alpha = val.alpha
end
end
I figured it thinks that all
Color objects are the same on all those sprites, so I started debugging there. And sure enough, they really were the same objects.
It seems like the default engine doesn't replace the
color property's value (which is a
Color object) in the
Sprite class. Instead it either clones the new
Color object and sets that for the value, or it sets the color's individual... color values (red, green, blue, alpha). Both would result in unique
Color objects, so no sprite would have the same
Color object.
While RGD is installed, it directly sets the
Color object for sprites. This resulted in the bug in the menu I have shown above. That color is made in a setting area (a constant in a module), and it assigned that same
Color object to all of my sprites, so once I changed the RGBA value of the color, on one sprite, all of my sprites got the change as well, since it's the same
Color object.
To prevent this from happening, I simply overwrote the default
color= set method in the
Sprite class. Now it sets the RGBA values instead of changing the
Color object completely. This restored the default behaviour.
I assume that this issue is present in the
Plane and
Viewport classes as well, but I didn't test those. Applying the same fix should work on those classes too.
This leaves the viewport and font issues only.
Ohh, and I also noticed another bug...
Bug 6:
Spoiler
The sprite's wave effect makes the edges of the image/bitmap get cut down.
The default engine didn't do this, it displayed every single pixel from the image/bitmap.
With RGD installed, if the image/bitmap gets out of the default image/bitmap's area, it gets cut down on the sides.
To test this, set the wave_length to a very high amount, and set the wave_amp and wave_speed to low values. This will create a slow wave effect, so you can clearly see the visual bug.
I actually prefer it this way in some cases, but in other cases, I need the whole image/bitmap shown even when a wave effect is active.