Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,510 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Dragble GUI code for your game #105735
01/07/07 13:45
01/07/07 13:45
Joined: Mar 2005
Posts: 296
Lithuania
S
Sader Offline OP
Member
Sader  Offline OP
Member
S

Joined: Mar 2005
Posts: 296
Lithuania

Re: Dragble GUI code for your game [Re: Sader] #105736
01/07/07 13:52
01/07/07 13:52

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Thanx a lot!
It's very usefull and well coded!
Also with snapping - wow!

thanx, mercuryus

Re: Dragble GUI code for your game [Re: ] #105737
01/07/07 14:12
01/07/07 14:12
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Amen... this is great!


~"I never let school interfere with my education"~
-Mark Twain
Re: Dragble GUI code for your game [Re: Germanunkol] #105738
01/07/07 14:37
01/07/07 14:37
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Nicely done.

One thing which I dont like is that you have to register these drag functions inside buttons or in the on_click function. It would be more useful and dynamic if you would register the panels like that with different modes and or additional panels (groups of panels). So, even if you have to write all the button-drag stuff in the button/panel definition you could leave out the registering and vice versa.

Try to improve it!

Last edited by HeelX; 01/07/07 14:38.
Re: Dragble GUI code for your game [Re: HeelX] #105739
01/07/07 15:25
01/07/07 15:25
Joined: Mar 2005
Posts: 296
Lithuania
S
Sader Offline OP
Member
Sader  Offline OP
Member
S

Joined: Mar 2005
Posts: 296
Lithuania
You are saying that you would love to
assign drag function for panels not by changing panel descriptionbut but assign it by some another function for example like
function addDragFuncToPanel(panel_name)
{
}
?

I just have tryed some trick with this code of line
r.on_click = panelDragBgr;
and it worked
the problem is that panel on_click event should be empty becouse it will be overwrited, but this registration realy is pasible and it may be that it's realy more comfortable than changeing panel object manualy

it is better than r.on_click = panelDragBgr; ???
addDragFuncToPanel(r); // now can be draged if you will click on it's background

It look's that in 6.40v=> is possible add elements to panel dinamicly
if answer is yes than it's worth to try write funciion which add full panel.width button add the top of panel (like window caption bar) and will execute panelDragBtn()

can you explane this idea a bit
Quote:

different modes and or additional panels (groups of panels)




Re: Dragble GUI code for your game [Re: Sader] #105740
01/07/07 15:47
01/07/07 15:47
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
I dont like the idea to intermingle things. There I have my panel definitions with assigned functions for the game and there I have my GUI manager and there would be the "drag" manager which will be called each frame by my GUI system.

So I simply want to write into the init function of my GUI system drag_register(panel); and I'm ready. The idea of groups is a bit bigger: in window forms you've got usually the title bar to move around a window. So _I_ would register all panels belonging to a window (title bar, icons un the upper right resize panel, subelements like lists, checkboxes, whatever) into one window group ("all items belong to window Nr. X").
So, I would register then the title bar as drag source and if I move the title bar x=+10,y=+20 to the lower right corner, all group elements move the same. So I would register several panels first as a group and THEN I register one panel as drag panel.. all by function calls, because it could be that I want own functions inside buttons or on on_click


Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1