Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 15,499 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Where do I put mouse pointer code? #267778
05/26/09 08:10
05/26/09 08:10
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
I am trying to make this:

A player walks up to a poster, when player hits a key(predefined) a mouse pointer shall appeare.So you can click the poster and a panel comes up. Then you use the mouse pointer to click buttons on panel. When finished bouth panel and mouse pointer is hidden again.

example:
if(key_h)
{some code to get the mouse pointer show}

Where do I put the code for the mouse pointer?
In the player code?
In the function or action that calls the panel whit buttons?
In the main code?
Or do I make a code page of its own, and just call it from there?


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: Where do I put mouse pointer code? [Re: Eagelina] #267780
05/26/09 08:23
05/26/09 08:23
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
There are many ways to do this.
But, it makes sense to use a global variable to make differences of global states: state_poster, state_running_around, state_menu etc..

In a main function you can run a while loop where you switch between the states and run the depending functions.

Pseudo code:

function general_states

while

if key_h && general_state == state_running_around

general_state = state_poster
mouse_mode = 1;
mouse_pointer = 1;
mouse_map = arrow_bmp;


if general_state == state_poster

mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;

if key_h && general_state == state_poster

general_state = state_running_around
....

Re: Where do I put mouse pointer code? [Re: Pappenheimer] #267781
05/26/09 08:26
05/26/09 08:26
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
Yes, that looks like a good solution. I will try it and see how it works for me. grin

So many ideas to try, and to litle hours in the day......


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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