Forum
Thanks. I've added myself as a watcher on that one.
Even if this would work, I don't think it would solve the issue in my case. It appears that Ashton has a dependency on TexPlay gem as well; which is the same reason I'm unable able to use Devil. TexPlay won't compile on El Capitan.
Is there a way in Gosu to render an image onto another image rather than directly onto the window? In this way I could dynamically build the image and then save the image to file. This seems like something would be a pretty popular feature.
It looks like Ashton never implemented the Window#to_image it was on the TODO list on the wiki
https://github.com/Spooner/ashton/wikiI cloned the project and took a look hoping it was there, but sadly no.
Maybe the opengl gem could be used to do this piece as bestguigui suggested, although I have not worked with that gem in the past and am not quite clear on how I would convert that to a Gosu image so as to be able to save it.
I'm currently building a font editing tool in Gosu and I need to be able to capture rectangle from within the window object into an image and then save this to disk. Is there a way to do this directly in Gosu?
I did look into using Devil as an option with Gosu, but that is dependent on the TexPlay gem which has not been maintained in quite a long time and it is not working with the latest version of Mac OS X El Capitan.
Tk has the update method, but it's considered an anti-pattern to use it (Under certain cases, which I have not personally encountered, the Tk loop can get out of sync with events when using update directly). The recommended mechanism is use the .after method that is used as a callback from mainloop. So that is what I tried initially after your update. It looked something like this.
def step(window, root)
window.tick
root.after(1000, step(window, root)
end
root = TkRoot.new { title "ex1" }
TkLabel.new(root) { text "hello world"; pack { padx 15; pady 15; side "left"; }; }
root.after(1000, step(window, root))
root.mainloop
The expected behavior there would be that Tk calls step once in approximately 1 second from now and then step adds itself back so that it will happen again. But this was still causing some type of contention between Tk and Gosu and you end up with an unresponsive application.
I agree that most Ruby GUI toolkits have been left to rot, which is the sole reason I use Tk with Ruby since it is part of the standard library and I actually kept maintained (
http://ruby-doc.org/stdlib-2.0.0/libdoc/tk/rdoc/).
If you can release a beta gem with the support you've described here I would love to give it spin.
I'm trying to use Gosu to create a custom image editor for one of my games and I need some pretty heavy GUI needs in this case. I thought using Tk would be an easier way to do the GUI piece, but I'm having issues with the application locking up whenever I try to use both Gosu and Tk in the same project. I'm wondering if anyone else has done this and maybe could point me in the direction of some basic example code that could help me to get going in the right direction?
Thank you. It looks like the Ashton::Texture is what I'm looking for. I'm running into an issue that appears to be a bug with Ashton; I'll see if I can figure that out.
That's not what I'm doing. I'm doing organic life growth type of simulations. So the trails continue to build up over time showing the patterns. It's actually pretty cool.
I'm trying to create a permanent blur/trail. Storing in something like an array in my case would result in too many draw calls over time. In other frameworks I have seen a feature where you can draw to an in memory image and then blit that to a window surface.
I would like to create a blur or trail effect where on my object and was trying to find a way to do this. I thought this may be possible using the Window.record method, but didn't see how I would achieve this. Does anyone have a real basic example of how this could be achieved, or is this not possible?
Thanks
I know this is an old thread, but I was looking to see if anyone had tested with RubyMotion and came across this...
On the Android front I wonder if Gosu would possibly work with Ruboto.
https://github.com/ruboto It is an implementation of Ruby on Android running on JRuby.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill