Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
516 stars 133 forks source link

Workaround for drawing semi-circles #117

Closed PabloNeirotti closed 3 years ago

PabloNeirotti commented 9 years ago

Hey guys!

Continuing my efforts to port Unveil to RKXP, I was wondering if there is any alternative library I can use to draw semi circles. I am currently focusing on making it work for Windows, since I have many Win32API dependencies so far, including the Steam API.

Here is a semi circle used in game: Unveil semi circle

If you look at the bottom-middle gauge, it is composed of two circles:

I need to draw these dynamically here (and across other UIs in the game) because the color can change to indicate cold, normal or hot temperature states (blue, orange or red).

Right now, to draw this I am using BitmapEx: http://www.whiteflute.org/wfrgss/?mode=view&realmId=1&pageId=25#h5_simple_draw_pie28start_x2c20start_y2c20end_x2c20end_y2c20color202cstart_angle202c20sweep_angle202cfill202cwidth203d20129

This relies on wfbitmap.dll - currently all calls to this are failing, or at least printed on Terminal because of the MKXP.puts("[#{@dll}:#{@func}] #{args.to_s}") if !@called line in the Win32API wrapper. I am guessing because it's trying to use GDI and you guys OpenGL, reason why I want to migrate to RKXP.

Any noob-friendly method to draw this? Hopefully without compiling, I read some Ubuntu instructions and wasn't sure how to replicate it on Windows.

But oh well. Any suggestions would be much appreciated. Thank you!

PabloNeirotti commented 9 years ago

I found some scripts to draw this on Ruby. While naturally isn't as fast (although I didn't notice a slow down in FPS on my setup), the rough edges, omg, the rough edges.

Since this uses OpenGL (right? I keep saying so), is there any method for drawing arcs with smooth edges that could be used? Anyone knows anything about this?

Thanks!

Ancurio commented 9 years ago

Sounds like you're looking for something with anti-aliasing.

PabloNeirotti commented 9 years ago

Yes. Do you know anything that could be implemented as a Ruby script? All of those that I find don't use anti-aliasing. Another one used images (that's acceptable) but it was really slow to draw.

The last resource is to find a way to draw a Spriteset of 180 positions for the gauge and draw the corresponding one. It's not ideal though...

Ancurio commented 3 years ago

Closing as unrelated to mkxp.