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), 18,619 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
Question of workshop chepter 14 #286913
08/28/09 08:15
08/28/09 08:15
Joined: Aug 2009
Posts: 29
satrebor Offline OP
Newbie
satrebor  Offline OP
Newbie

Joined: Aug 2009
Posts: 29
I opened scipt of workshop (script14_2.c)
I see that two wizards are glowing when you put a cursor on it.
But I dont know a code. :|

Where exactly said that wizards selected??I cant see a line about wizards.?

Iam new.







unction highlight_event()
{
if (event_type == EVENT_TOUCH) // the wizard was touched with the mouse?
{
my.ambient = 100; // the make it look bright
my.lightrange = 200; // and generate light on a radius of 200 quants!
}
else // the wizard isn't touched anymore
{
if (event_type == EVENT_RELEASE) // the mouse was moved away from it?
{
my.ambient = 0; // then restore its initial ambient value (zero)
my.lightrange = 0; // and stop it from generating light around it
}
}
}

action wizard_lights() // this action is attached to both wizards
{
// make the wizard models sensitive to mouse touching and releasing
my.emask = ENABLE_TOUCH | ENABLE_RELEASE;
// run function highlight_event the wizards are touched or released
my.event = highlight_event;
}

function main()
{
video_screen = 1; // start in full screen mode
video_mode = 7; // use a screen resolution of 800 x 600 pixels
level_load ("work14_2.wmb"); // load the level
mouse_mode = 1; // show the mouse pointer
mouse_map = cursor_pcx; // set the mouse pointer bitmap

while (1)
{
mouse_pos.x = mouse_cursor.x; // allow the mouse pointer to move
mouse_pos.y = mouse_cursor.y; // on the x and y axis
camera.pan -= mouse_force.x;
camera.tilt += mouse_force.y;
wait (1);
}
}

Re: Question of workshop chepter 14 [Re: satrebor] #286914
08/28/09 08:27
08/28/09 08:27
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
my.emask = ENABLE_TOUCH | ENABLE_RELEASE;

ENABLE_TOUCH make the wizard sensitive to the mouse.
ENABLE_RELEASE is when the mouse move from the wizard away.

my.event = highlight_event;

This function is called if the mouse is over the wizard or remove from it.

All other is explain in the code (or in the Workshop / Manual)

Last edited by Widi; 08/28/09 08:28.

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