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 (Dico), 16,767 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
Roll mouse #148377
08/16/07 18:13
08/16/07 18:13
Joined: Aug 2006
Posts: 78
A
amadeu Offline OP
Junior Member
amadeu  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 78
Hallo

I would like to know how is the name of the roll buttom (middle botton) of the mouse in liteC. I would like to do zoom in and out with this button.

Thanks

Re: Roll mouse [Re: amadeu] #148378
08/16/07 18:47
08/16/07 18:47
Joined: Aug 2005
Posts: 390
Florida
O
oldschoolj Offline
Senior Member
oldschoolj  Offline
Senior Member
O

Joined: Aug 2005
Posts: 390
Florida
Here is a code that I wrote which will allow you to zoom in and out with the mouse wheel, also you can hold down the middle mouse and move the camera around. It is set up for an RPG, so the camera is third person, the mouse mode will automatically change back and forth for you between camera functions, and selection cursor. The camera rotates around the player, you can play with the camera arc. and z position to move it higher or lower. Have fun!

Code:
function default_camera()
{
camera.clip_near = 0;
camera.tilt = -15;
// distance_to_player = c_trace (camera.x, player.x, IGNORE_ME | IGNORE_SPRITES | IGNORE_PASSABLE);
while (1)
{
if (mickey.z > 1)
{
mouse_mode = 0;
camera.arc += 10 * time_step;
}
if (mickey.z < -1)
{
mouse_mode = 0;
camera.arc -= 10 * time_step; // play with "10"
}
if(mouse_middle == 1)
{
mouse_mode = 0;
key_a = 0;
key_d = 0;
camera.pan -= mouse_force.x * 5 * time_step; //turn left and right
camera.tilt += mouse_force.y * 5 * time_step;
camera.x = player.x - 200 * cos(camera.pan); // camera follows player
camera.y = player.y - 200 * sin(camera.pan); // same here
camera.z = player.z +200; // place the camera above the player
vec_set(mouse_pos,mouse_cursor); // gets the point of cursor
}
else
{
mouse_mode = 2;
camera.x = player.x - 200 * cos(player.pan); // camera follows player
camera.y = player.y - 200 * sin(player.pan); // same here
camera.z = player.z +200; // place the camera above the player
camera.pan = player.pan; // the camera and the player have the same pan angle
vec_set(mouse_pos,mouse_cursor);
}
camera.arc = minv (maxv (camera.arc, 10), 120);
wait (1);
}
}



be sure to include this in your main function in this order:

Code:
mouse_mode = 0;
wait(3);
// now load the level
level_load("your_level.wmb");
while (player == NULL) {wait (1);}
mouse_map = yourmousemap_pcx;
default_camera();




you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe. __________________________________ yours truly
Re: Roll mouse [Re: oldschoolj] #148379
08/16/07 20:33
08/16/07 20:33
Joined: Aug 2006
Posts: 78
A
amadeu Offline OP
Junior Member
amadeu  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 78
thanks


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