Collision-based polygonal button system


#1

I don’t know how you guys use geometry for button. Using DirectGUI with geom or image doesn’t behave as I need. Moreover, I don’t think it’s trivial to inject collision system inside the existing GUI system.
So I created my own button system, with more risks, but the nice thing is I can extend it anyway I need.

Download :
polygonal_button.zip


how best to make a 3D GUI?
#2

Dang! Thats some seriously nice work! Thanks for sharing…i’m studying it and learning stuff right now.

Thanks


#3

8)

UPDATE :

  1. added keyboard controls (left & right arrow) to select dialog’s button. Press Enter to run button’s command

#4

:open_mouth:
Hi ynjh_jo
i run testing this program

but it show error
line 447 np.setTransparency(1)
AttributeError : ‘NoneType’ object has no attribute ‘setTransparency’

error b’coz code or my python version?? :cry:


#5

You probably have put the data files into the wrong position. Some “could not find” error has probably occured a few lines before you get the described error.

If you load a model into a variable, which cannot be found, the variable will be set to None. None does not have any functions, thus this error.


#6

thank you :blush:


#7

UPDATE :

  1. organized & simplified the enable/disable button state functions.
  2. the button’s geometry scale saved to be able to restore it when a button get released, after get shrunk upon pressed.

#8

UPDATE :
Now you can hook a command when a button is highlighted, and when it’s not. This is demonstrated by the 3 3d models.


#9

thanks man really that was a pricless effort


#10

I missed this cool snip - thank god have been revived!


#11

thank you!
I love this.