GLBasic forum

Codesnippets => DD-GUI => Topic started by: backslider on 2010-Jul-19

Title: selfmade graphics?
Post by: backslider on 2010-Jul-19
Hi guys,
is it possible to use own graphics for the ddgui elements like window background or sliders?

greets
Title: Re: selfmade graphics?
Post by: Kitty Hello on 2010-Jul-26
You can (so far) search the DDgui.gbas for CALLBACK functions and overwrite these.
Hiro did that once to get the brushed metal look of OSX into DDgui.
I plan to add skinning to DDgui later, so each widget get's a function prototype that is used for drawing and/or handling the widget. That way you can easily make user defined widgets, too.
Title: Re: selfmade graphics?
Post by: DmitryK on 2010-Nov-15
Hello Kitty!

1. I'm trying to make another look for a slider component (I just want to use bitmap for it) but with no success
function DDgui_draw_user% gets id$, width%, height%, ytop%
but within it I have to send ddgui_vals, wdg, ytop% to new function DDgui_drawslider2
what is the right way I can do it ?

2. could you disclose your plans about DDGui's skining functionality, please ?

best regards,
Dmitry
Title: Re: selfmade graphics?
Post by: trucidare on 2010-Nov-16
ddgui is fully skinnable
Title: Re: selfmade graphics?
Post by: Kitty Hello on 2010-Nov-16
DDgui_user is just for user defined widgets.

You might want to overwrite the DDgui_backgnd function.

Or - what do you want in detail?
Title: Re: selfmade graphics?
Post by: DmitryK on 2010-Nov-16
to be more clear I attached 2 pictures
1. as is - old_slider.jpg
2. as I want to be - new_slider.jpg (as example)


[attachment deleted by admin]
Title: Re: selfmade graphics?
Post by: Kitty Hello on 2010-Nov-16
oh. That's not possible at the moment. We need a way to really skin the elements, but it's not done, yet.
Title: Re: selfmade graphics?
Post by: MrTAToad on 2010-Nov-16
Problem being once you allow skinning, you are going to have to use sprites for everything...
Title: Re: selfmade graphics?
Post by: DmitryK on 2010-Nov-16
thank you for your answers
I will try to find a way to avoid the limitation
Title: Re: selfmade graphics?
Post by: Slydog on 2010-Nov-16
I've written my own GUI system because I wanted skinning.
It was a pain, but it's starting to take shape.
I'm working on kinetic scrolling now, not too difficult, but having it stop at snap-to points is tricky.
I use a skin.png file and have routines to tell the GUI where each element is located.
Plus you can specify the left, right and middle portions to allow all control sizes without stretching.
[Edit: It also allows different graphics / colours for different states, like below the 'PLAY' button is being pressed]
It uses PROTOTYPEs for events too. 
DD-GUI has way more features tho.

Here's a screenshot of my progress:

[attachment deleted by admin]
Title: Re: selfmade graphics?
Post by: MrTAToad on 2010-Nov-16
Looks nice!
Title: Re: selfmade graphics?
Post by: DmitryK on 2010-Nov-16
yea, it's really nice !
Slydog, how many lines of code you had to write ?
Title: Re: selfmade graphics?
Post by: Slydog on 2010-Nov-16
Thanks.
The GUI code alone is 1600+ lines.
The 'slider' itself is 300 lines of code.

But, it uses my custom font/text routines, which is another 350 lines.
Plus, it uses many of my other TYPEs and common routines (at least 1000+ more lines).
Title: Re: selfmade graphics?
Post by: DmitryK on 2010-Nov-16
oh, you ~ on the half way to DDGui with its 3600 lines :)

I plan to make a simple inplace GUI just for my coming match-3 game
and then will see

   
Title: Re: selfmade graphics?
Post by: backslider on 2010-Nov-19
Amazing Slydog! :)