Collision-based polygonal button system

Panda3D Forum Index -> Code Snippets Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ynjh_jo


Posts: 1596
Location: Malang, Indonesia

PostPosted: Fri Jul 20, 2007 7:20 pm    Post subject: Collision-based polygonal button system Reply with quote
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.
screenshot :


Download :
polygonal_button.zip
_________________
http://ynjh.panda3dprojects.com | http://ynjh.p3dp.com
Intel P4Prescott 2.8GHz HT | Elixir 1.5GB | ATI HD4670 1GB GDDR3


Last edited by ynjh_jo on Fri Apr 17, 2009 7:59 pm; edited 3 times in total
Liquid7800


Posts: 140

PostPosted: Tue Jul 24, 2007 11:53 pm    Post subject: Reply with quote
Dang! Thats some seriously nice work! Thanks for sharing...i'm studying it and learning stuff right now.

Thanks
ynjh_jo


Posts: 1596
Location: Malang, Indonesia

PostPosted: Wed Jul 25, 2007 12:29 pm    Post subject: Reply with quote
Cool
UPDATE :
1. added keyboard controls (left & right arrow) to select dialog's button. Press Enter to run button's command
_________________
http://ynjh.panda3dprojects.com | http://ynjh.p3dp.com
Intel P4Prescott 2.8GHz HT | Elixir 1.5GB | ATI HD4670 1GB GDDR3
Gorn


Posts: 37

PostPosted: Sat Aug 25, 2007 1:49 am    Post subject: Reply with quote
Shocked
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?? Crying or Very sad
Hypnos


Posts: 546
Location: Zürich, Switzerland

PostPosted: Sat Aug 25, 2007 3:50 am    Post subject: Reply with quote
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.
Gorn


Posts: 37

PostPosted: Sat Aug 25, 2007 7:25 am    Post subject: Reply with quote
thank you Embarassed
ynjh_jo


Posts: 1596
Location: Malang, Indonesia

PostPosted: Sat Aug 25, 2007 11:03 am    Post subject: Reply with quote
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.


Last edited by ynjh_jo on Fri Apr 17, 2009 8:04 pm; edited 1 time in total
ynjh_jo


Posts: 1596
Location: Malang, Indonesia

PostPosted: Fri Apr 17, 2009 8:02 pm    Post subject: Reply with quote
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.
_________________
http://ynjh.panda3dprojects.com | http://ynjh.p3dp.com
Intel P4Prescott 2.8GHz HT | Elixir 1.5GB | ATI HD4670 1GB GDDR3
AAKN


Posts: 8
Location: India

PostPosted: Wed May 13, 2009 2:03 am    Post subject: Reply with quote
thanks man really that was a pricless effort
astelix


Posts: 851
Location: Milano, ITA

PostPosted: Wed May 13, 2009 4:58 am    Post subject: Reply with quote
I missed this cool snip - thank god have been revived!
_________________
My Rig:
P3D 1.7.0@WinXP & Kubuntu 10.04- Athlon 64 5200 X2 ~ Radeon 3200HD (integrated)
Display posts from previous:   
Post new topic   Reply to topic    Panda3D Forum Index -> Code Snippets All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group