BASIC

Author Topic: selfmade graphics?  (Read 5438 times)

Offline backslider

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 892
    • View Profile
selfmade graphics?
« on: 2010-Jul-19 »
Hi guys,
is it possible to use own graphics for the ddgui elements like window background or sliders?

greets

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10656
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: selfmade graphics?
« Reply #1 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.

Offline DmitryK

  • Mc. Print
  • *
  • Posts: 44
  • ......................................
    • View Profile
    • DK's mobile games
Re: selfmade graphics?
« Reply #2 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
Our life is just a Game!

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: selfmade graphics?
« Reply #3 on: 2010-Nov-16 »
ddgui is fully skinnable
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10656
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: selfmade graphics?
« Reply #4 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?

Offline DmitryK

  • Mc. Print
  • *
  • Posts: 44
  • ......................................
    • View Profile
    • DK's mobile games
Re: selfmade graphics?
« Reply #5 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]
Our life is just a Game!

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10656
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: selfmade graphics?
« Reply #6 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.

MrTAToad

  • Guest
Re: selfmade graphics?
« Reply #7 on: 2010-Nov-16 »
Problem being once you allow skinning, you are going to have to use sprites for everything...

Offline DmitryK

  • Mc. Print
  • *
  • Posts: 44
  • ......................................
    • View Profile
    • DK's mobile games
Re: selfmade graphics?
« Reply #8 on: 2010-Nov-16 »
thank you for your answers
I will try to find a way to avoid the limitation
Our life is just a Game!

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 928
  • KodeSource
    • View Profile
    • KodeSource
Re: selfmade graphics?
« Reply #9 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]
« Last Edit: 2010-Nov-16 by Slydog »
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

MrTAToad

  • Guest
Re: selfmade graphics?
« Reply #10 on: 2010-Nov-16 »
Looks nice!

Offline DmitryK

  • Mc. Print
  • *
  • Posts: 44
  • ......................................
    • View Profile
    • DK's mobile games
Re: selfmade graphics?
« Reply #11 on: 2010-Nov-16 »
yea, it's really nice !
Slydog, how many lines of code you had to write ?
Our life is just a Game!

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 928
  • KodeSource
    • View Profile
    • KodeSource
Re: selfmade graphics?
« Reply #12 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).
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline DmitryK

  • Mc. Print
  • *
  • Posts: 44
  • ......................................
    • View Profile
    • DK's mobile games
Re: selfmade graphics?
« Reply #13 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

   
Our life is just a Game!

Offline backslider

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 892
    • View Profile
Re: selfmade graphics?
« Reply #14 on: 2010-Nov-19 »
Amazing Slydog! :)