View Full Version : 2D Library
Greetings and Happy New Year to thinBasic staff and users. There's been alot of updates to thin basic since I last logged on. Great : )
Keep up the good work. I was just wondering if there are any 2D libraries that work with thinBasic. (i.e SDL, Allegro etc.) ;D
Thanks,
Pipes
Michael Clease
05-01-2009, 21:15
simple answer yes.
Look at Jose Roca forum
http://www.jose.it-berater.org/smfforum/index.php?board=316.0
I would confirm with Jose what header are compatible with Thinbasic.
Michael Hartlef
06-01-2009, 17:36
Hi Pipes,
what functionalities do you need? Petr and me are starting to work together on our modules soon.
I have personally a great interest in more 2D functionalies for thinBasic, game related. So please let us know what you need and we can see what we can come up with. Depending on the features you need it might be possible with TBGL allready.
In the meanwhile I suggest to follow the link Michael Clease gave you.
Hi Michael,
Sorry for not responding quickly. In answer to your questions, there are several functionalities I'd like in a 2D library. Here are a few:
Load Image - Load an image into an image buffer (bmp, jpg, png, etc.)
Copy Image - Copy a loaded image into another image in which the copy creates the image buffer
Create Image - create a blank image buffer (bmp, jpg, png, etc.) user designated size
Load Animated Image - Load a series of animated images for playback & a function to playback the animation
Free Image - free an image buffer from system resources
Save Image - save an image buffer to disk
Grab Image - grab a portion of an image and copy it to another image buffer, screen or disk
Draw Image - draw an image to screen or image buffer
Display an Image buffer - Draw any buffer to screen
Mask Image - choose an RGB color as a transparent color
Change Image Handle - Grab image to mouse and designate the handle (i.e. Top left corner, middle, bottom right corner etc.)
Scale Image - Scale an image and store it in a buffer
Resize Image - (self explanatory)
Rotate Image - (self explanatory)
Image Width - return image width
Image Height - return image height
Images Overlap - check if images overlap
Images Collide - pixel collision detection
Rectangles Overlap - image captured to mouse overlaps with image on screen
Rectangles Collide - image pixels captured to mouse collide with image on screen
Flip buffers - Flip a series of image buffers (whole Screen size) onto the screen
These are a few that I can think of for now. Oh yeah... one more simple request... keep it simple for BASIC programmers and not windows gurus. :lol:
Michael Hartlef
27-01-2009, 18:37
Hi Pipes,
are you talking about image functionalities acting inside regualr windows/dialogs or inside a TBGL/OpenGL window?
It sounds more like image handling stuff for regular windows/dialogs. Eros introduced an image component recently. Maybe thta is something what you are looking for. Eros!?!? What do you think?
ErosOlmi
27-01-2009, 18:45
I think Pipes is referring here to "Image" as "sprite" or something like that. So something more close to gaming than drawing.
CANVAS control can be used to develop many of the requests but it would be limited to BMP.
For sure CANVAS will be improved in next thinBasic release but more on the drawing side not on the gaming direction.
Ciao
Eros
PS: @Michael, TBGL included in current thinBasic 1.7.6.0 has been compiled using SVN repository so it has all the new stuff you have developed on 2D side ;)
Petr Schreiber
27-01-2009, 18:52
Hi,
yes, Michael is helping a ton with TBGL now, once ready and documented, 2D people from here will have big power in their hands. Stay tuned ;)
Petr
Wow! You guys jumped all over my post quickly. I've only been logged off for about 30 minutes and came back on to inquired about call backs. That's what I like about thinbasic and it's community. Quick responses... I appreciate the quick replies.
are you talking about image functionalities acting inside regualr windows/dialogs or inside a TBGL/OpenGL window?
Yes... either one.
I think Pipes is referring here to "Image" as "sprite" or something like that. So something more close to gaming than drawing.
Yes... I meant image as any pic (sprites are just small images)
Yes... These functionalities would be for gaming... what else is there :lol:
Yes... some drawing primitives would be cool also... i.e. lines, rectangles, squares, filled and non-filled on a window canvas and tgbl screens
I've only observed the example scripts in action for TGBL. It looks good. I havn't had time to try any programming with it yet.
Thanks for the responses... :)
ErosOlmi
27-01-2009, 19:35
Pipes,
to have a look at what Michael was referring as new Canvas control, install thinBasic 1.7.6.0 (current latest one) and have a look at script in directory \thinBasic\SampleScripts\UI\Canvas\
It is a new User Interface control just introduced. This is just a basic drawing control that will be further developed in future thinBasic release.
I think for gaming and 3D/2D, TBGL module is the perfect place where to work. It already has great great power and adding some native 2D will further improve its credibility (already very high) and potential user base.
Ciao
Eros
Michael Clease
27-01-2009, 22:14
Yes... I meant image as any pic (sprites are just small images)
very simple build a square and bind a texture (your image)
Yes... some drawing primitives would be cool also... i.e. lines, rectangles, squares, filled and non-filled on a window canvas and tgbl screens
same method as above, look at Polygonal modelling and texture setup. I wont bother posting a simple example when I get time.
Michael Hartlef
27-01-2009, 22:15
Ouch, I didn't know that. I have to look which commands are allready in and then give oyu guys here a short description upfront. :)
Michael Hartlef
27-01-2009, 22:17
Michael, sure you can do these things allready. But I add some stuff to make things easier AND a little bit faster. But of course, it does not prevent you from using other technics too. Use what technic you like to use the most. That is so great about thinBasic. It's so open and flexible.