How do i make pictures be clickable? PLZ HELP ME THIS IS URG
Author |
Message |
cema_seven
|
Posted: Wed Jun 14, 2006 4:53 pm Post subject: How do i make pictures be clickable? PLZ HELP ME THIS IS URG |
|
|
In turing i have to make an ISU and i forgot how to make pictures so that i can click the like a button. someone plz help me |
|
|
|
|
|
Sponsor Sponsor
|
|
|
TheOneTrueGod
|
Posted: Wed Jun 14, 2006 4:58 pm Post subject: (No subject) |
|
|
you have to check the mouse's position, and if the button is held down and if its in an area inside the picture, then make something happen...
Research mousewhere (or Mouse.Where, they are effectively the same thing, but one is a part of the Mouse module, and one isn't...) Both are in the F10 help menu, or probably in the [Turing Walkthrough] |
|
|
|
|
|
cema_seven
|
Posted: Wed Jun 14, 2006 4:59 pm Post subject: (No subject) |
|
|
*** click them like a button *** |
|
|
|
|
|
Clayton
|
Posted: Wed Jun 14, 2006 5:10 pm Post subject: (No subject) |
|
|
well i dont know for sure, but i think you can do picture buttons with turing (probably not though), if you cant, just draw the picture over turings gui buttons (or make your own button class ) and use that, other than that, go with TheOneTrueGods suggestion, look through the turing help menu that comes with turing to research picture buttons |
|
|
|
|
|
cema_seven
|
Posted: Wed Jun 14, 2006 5:13 pm Post subject: (No subject) |
|
|
can you please some how tell me an example code cause i tryed looking but i can't find anything and i dunno any codes |
|
|
|
|
|
Clayton
|
Posted: Wed Jun 14, 2006 5:15 pm Post subject: (No subject) |
|
|
look in the Turing Walkthrough at the Pic commands and the GUI commands, we are not going to do this for you, you have to do some research first and show us what youve attempted, then well help you out some more |
|
|
|
|
|
BenLi
|
Posted: Thu Jun 15, 2006 8:52 pm Post subject: (No subject) |
|
|
code: |
var mx,my,mb:int
loop if you need to continually check for mouse
mousewhere (mx,my,mb)
if mx > picturex and mx<picturex2 and my > picturey and my <picturey2 and mb = 1 then
%dostuff
end if
end loop
|
|
|
|
|
|
|
BenLi
|
Posted: Thu Jun 15, 2006 8:55 pm Post subject: (No subject) |
|
|
if you don't know the coordinates of the pic...
code: |
drawpic
var mx,my,mb:int
loop
mousewhere (mx,my,mb)
locate (1,1)
put mx
locate (2,1)
put my
end loop
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Bored
|
Posted: Fri Jun 16, 2006 9:20 am Post subject: (No subject) |
|
|
Well here is a psuedo code version that describes the basic logic of a button. code: | loop
if mouse over picture then
if mouse is down then
pressed is true
elsif pressed is true then
pressed is false
do stuff (user pressed button)
end if
else
pressed is false
end if
end loop |
|
|
|
|
|
|
|
|