I guess this a *big* request but I would eventually like to see an OpenGL library geared towards 2D gaming in Basic4Android
Even as a separate "paid-for" library
I had a crack at writing a library for another language, but would have no idea how to create such a library in Android and interface it with b4a
The general features I have in mind:
+ Images load as textures (auto-resized to power of 2)
+ Each image has an anchor/hotspot (for rotating/offsetting). Commands Such as image.MidHandle , image.SetHandle(xoffs,yoffs) would determine the hotspot position
+ Each image can have its own colour, alpha, blend mode, scaling **, and rotation defined
** Images can be flipped by setting negative scaling values
+ Animation - Since the image is a texture then animation is best done via defining an area within an area of the texture. This is good for memory and performance (single-surface). Three commands come into play:
+ Images can be duplicated (thus sharing the same texture for single-surface reasons)
+ Global screen scale and rotation
Effects all rendered images
+ A reset option to restore the image to its basic defaults
This resets rotation, scaling, blend, colour
Yup, now that's a feature request!
Even as a separate "paid-for" library
I had a crack at writing a library for another language, but would have no idea how to create such a library in Android and interface it with b4a
The general features I have in mind:
+ Images load as textures (auto-resized to power of 2)
+ Each image has an anchor/hotspot (for rotating/offsetting). Commands Such as image.MidHandle , image.SetHandle(xoffs,yoffs) would determine the hotspot position
+ Each image can have its own colour, alpha, blend mode, scaling **, and rotation defined
** Images can be flipped by setting negative scaling values
+ Animation - Since the image is a texture then animation is best done via defining an area within an area of the texture. This is good for memory and performance (single-surface). Three commands come into play:
B4X:
image.SetFrames(columns,rows)
image.Frame=thisframe ' set frame to view (0=first frame)
+ Images can be duplicated (thus sharing the same texture for single-surface reasons)
B4X:
image.DuplicateImage(thisimage)
image.SetFrameRect(x,y,w,h) ' determine area within the images texture to use
+ Global screen scale and rotation
Effects all rendered images
+ A reset option to restore the image to its basic defaults
This resets rotation, scaling, blend, colour
Yup, now that's a feature request!