Page 1 of 1
does initengine3d mess up initsprite functions?
Posted: Wed Nov 04, 2009 4:38 am
by Suirad
i was using functions that are used in the sprite2d library.
i decided to add 3dengine to make use of the gadget3d functions. after adding initengine3d() i now get errors when trying to manipulate sprites (transparentspritecolor() ect.)
would anyone have a fix or tip that could help me?
Re: does initengine3d mess up initsprite functions?
Posted: Wed Nov 04, 2009 5:27 am
by Rook Zimbabwe
I haven't mixed them but I remember reading something about billboards... maybe you could flop the sprite image on a billboard and mmove and manipulate the billboard?
Billboards are 3D planes (composed of 2 triangles) which always face the camera. Billboards are useful to quickly render a high number of elements, such as rain, snow, trees, vegetation or any particle-based effects. InitEngine3D() should be called successfully before using any billboard functions.
Billboards are added to billboard groups, which are collections of similarly sized and positioned billboards, so that they may be displayed.
Just imagine your sprites as particles... good examples in the HELP of 4.3!
Re: does initengine3d mess up initsprite functions?
Posted: Wed Nov 04, 2009 9:26 am
by djes
Suirad wrote:i was using functions that are used in the sprite2d library.
i decided to add 3dengine to make use of the gadget3d functions. after adding initengine3d() i now get errors when trying to manipulate sprites (transparentspritecolor() ect.)
would anyone have a fix or tip that could help me?
Not by now, we're waiting the next beta.
Re: does initengine3d mess up initsprite functions?
Posted: Wed Nov 04, 2009 11:19 am
by Kaeru Gaman
note that Engine3D uses DX9 and some of the 2D functions are not present anymore in DX9.
UseBuffer is slower, StartDrawing on Screen does not work, some things like that...
all those issues were discussed all around the forums since months.
it's a DX9 issue, no PureBasic bug.
I don't remember problems with TransparentSpriteColor though.
Anyhow: Gadget3D is a whole lot of work to deal with, just to use some Gadgets on a 2D screen it's overkill.
better create your own 2D-GUI, that's much easier if you familiar with 2D Grafix manipulation.
Re: does initengine3d mess up initsprite functions?
Posted: Wed Nov 04, 2009 10:43 pm
by Suirad
ok thanks for the reply's guys(&gals?)
while at school i think i thought of a fix for my problem (as it was the reason for wanting to use gadget3d)
ok, my 2 next questions:
In my game i have the display and graphics handling on a seperate thread, when i use that and try to have regular gadgets on screen in my main thread, any gadgets i have there flash.
*to the point:
1: does WindowEvent() refresh the gadgets?
2: and if so, should i move WindowEvent() to my drawing/displaying thread
Re: does initengine3d mess up initsprite functions?
Posted: Wed Nov 04, 2009 10:57 pm
by Kaeru Gaman
any manipulation and checking of gadgets should happen within the same thread the window and gadgets were created.
normal gadgets
can not be put upon a windowedscreen, only aside.
if you want buttons on a fullscreen, create them on your own using sprites and check the clicks via coordinates.
example:
http://www.purebasic.fr/german/viewtopic.php?t=18504
Re: does initengine3d mess up initsprite functions?
Posted: Wed Nov 04, 2009 11:05 pm
by Suirad
Kaeru Gaman wrote:any manipulation and checking of gadgets should happen within the same thread the window and gadgets were created.
normal gadgets
can not be put upon a windowedscreen, only aside.
if you want buttons on a fullscreen, create them on your own using sprites and check the clicks via coordinates.
example:
http://www.purebasic.fr/german/viewtopic.php?t=18504
well technically they can be placed on a windowedscreen(i have done it, it works fine as long as i dont flip the buffer or clear the screen [used it for my login screen, which is just a static background image])
your example would help, if i was in need of buttons. i am actually shooting more towards input boxes and edit boxes. this is the main reason i was considering gadget3d
Re: does initengine3d mess up initsprite functions?
Posted: Wed Nov 04, 2009 11:17 pm
by Kaeru Gaman
maybe it works but it's not meant to do it.
to the other point - depends on what your profession is.
text output on a screen is really easy, even with selfmade fontsets.
http://www.purebasic.fr/english/viewtopic.php?t=28597
when you think, it's reinventing the wheel - okay, use Gadget3D.
but I think it has more rough edges than you see at first sight.
for me, it's much easier to create my own GUI.
one step further - if I wanted something really text intensive,
I would ask myself if a screen was the right choice for the little bit grafix.
Re: does initengine3d mess up initsprite functions?
Posted: Wed Dec 15, 2010 7:46 pm
by Zach
I know this thread hasn't been posted on in a while, but I just had to comment..
I am kind of having to deal with the same problem of wanting to use gadgets to build a 2D GUI.
The problem is not that we just assume "why re-invent the wheel", if it were simple buttons and click registers, people would have a fair point. Buttons and a simple text printing function, overlaid on a window sprite are pretty trivial things to come up with..
But when we get into the realm of needing to have input boxes, and other more complex Gadgets, that can be a lot harder to come up with on your own.. It's often repeated around the web on the subject of GUI's , that it is much simpler to rely on tools that already exist, because building your own GUI framework can take a long time, and come with its own nightmares. Especially for those who want to focus on games for instance, or are simply much less skilled programmers.
Inputboxes don't just echo text.. They have an active caret that can be repositioned at will, be used to insert or delete an arbitrary character at will, be used to start a highlight section for cut/copy/paste operations at will, scroll left/right if the input string becomes longer than the physical box if desired, as well as have an arbitrary limit on the total number of characters.
I wouldn't even know where to start on coding that kind of functionality - much less doing it in an efficient manner. That's why 2D and 3D GUI resources are so vital for those of us just starting out, or with very little experience under out belts.
The billboard solution is something that I thought of as well, and if I can find any kind of workaround I'll be sure to come back with any ideas.
Re: does initengine3d mess up initsprite functions?
Posted: Fri Dec 17, 2010 2:47 am
by Suirad
i had found a 2d gadget library a while ago, try this out:
http://www.purebasic.fr/english/viewtopic.php?t=31357