getobjectat if object is invisible [SOLVED]

Started by Etcher Squared Games, Mon 27/12/2004 02:18:13

Previous topic - Next topic

Etcher Squared Games

here's the code I have:


#sectionstart repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute()
{
Ã,  // put anything you want to happen every game cycle here
Ã,  RefreshMouse();
Ã,  if (GetObjectAt(mouse.x, mouse.y) == 0)
Ã,  {
Ã,  Ã,  ObjectOn(0);
Ã,  }
Ã,  else
Ã,  {
Ã,  Ã,  ObjectOff(0);
Ã,  }
}
#sectionend repeatedly_executeÃ, 

I have object 0 initially invisible...
this code is not working as expected because I'm guessing getobjectat only works if the object is already visible

what I want to do is have the object show up when the user cursors over it and disappear once it moves away...


If i'm unable to do this, this will really hinder my new game idea...
website: http://www.etcher2games.com/
email: etcher2games@yahoo.com
forum: http://www.etcher2games.com/forums

Anyone want to make my website for free?

Candle


Etcher Squared Games

this doesn't seem to do anything with the object being invisible
mostly cursor stuff...

I'm ok with cursors, just the object itself

Quote from: Candle on Mon 27/12/2004 02:39:15
Would something like this work ? or maybe change to make it work ?
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=18228.0
website: http://www.etcher2games.com/
email: etcher2games@yahoo.com
forum: http://www.etcher2games.com/forums

Anyone want to make my website for free?

Etcher Squared Games

I have found a way around this in the meantime, but i REALLY don't like this solution....

I've drawn the object in the right shape, but drawn like the background.  This object is visible, but of course looks invisible.

So,once the cursor moves over it, I can switch it to the new frame.

But this is a pain if I ever want to move the object around in design mode
website: http://www.etcher2games.com/
email: etcher2games@yahoo.com
forum: http://www.etcher2games.com/forums

Anyone want to make my website for free?

strazer

You can try turning the object on, then setting it to 100% transparent with
  SetObjectTransparency(0, 100);
and back to non-transparent if the mouse is over the object.

I know that characters can still be clicked when they're turned off this way, don't know about objects. I also don't know if the GetObjectAt code works on transparent stuff or not.
Let us know how it turned out.

Etcher Squared Games

YES!!!

that did it!

thank you.

Quote from: strazer on Mon 27/12/2004 07:03:21
You can try turning the object on, then setting it to 100% transparent with
Ã,  SetObjectTransparency(0, 100);
and back to non-transparent if the mouse is over the object.

I know that characters can still be clicked when they're turned off this way, don't know about objects. I also don't know if the GetObjectAt code works on transparent stuff or not.
Let us know how it turned out.
website: http://www.etcher2games.com/
email: etcher2games@yahoo.com
forum: http://www.etcher2games.com/forums

Anyone want to make my website for free?

SMF spam blocked by CleanTalk