InGame Menus (Help/How to)

For topics that don't fit under the other topics or forums.

InGame Menus (Help/How to)

Postby Cs24 » Tue Nov 03, 2009 5:42 am

Could someone tell me how to make menus like the ones in these scenes?
Rating: rated 6.1
Filesize: 40.39 kB
Comments: 2
Ratings: 3
download

Rating: rated 8.4
Filesize: 76.25 kB
Comments: 12
Ratings: 18
download


(P.S. I'm not a noob in phun, just thyme, which I can assume is needed)
Newbie Thymer
Intermediate Phuner
Cs24
 
Posts: 41
Joined: Tue Nov 03, 2009 5:30 am

Re: InGame Menus (Help/How to)

Postby standardtoaster » Tue Nov 03, 2009 6:02 am

Code: Select all
    Scene.my.IsMouseInBox=(P1, P2, CIT, CIF) =>{App.mousePos(0) >= P1(0) && App.mousePos(1) <= P1(1) && App.mousePos(0) <= P2(0) && App.mousePos(1) >= P2(1) ? {CIT} : {CIF}}

This script will be able to tell if the mouse is in a box and adjust the color of it accordingly.

P1 stands for the first point you give it.
P2 stands for the second point you give it.
CIT stands for Color If True
CIF stands for Color If False

Ex. scene.my.IsMouseInBox([-1,1], [1,-1], [1,1,1,1], [0,0,0,1]) Put that into a box that is at [0,0] and has a size of 2x2. This will make it change to white if the mouse is in the box and make it change to black if the mouse is not in the box.

Put "Scene.my.IsMouseInBox(P1, P2, CIT, CIF)" Remove the quotation marks and make sure to replace the variables with values.

Image


That takes care of the "mouseover." To make the screen "change" You would change the the screen by changing the camera pan. scene.camera.pan = x, y value
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm


Return to Algodoo in general

Who is online

Users browsing this forum: No registered users and 5 guests