Implementing Custom Cursor (URGENT!)

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Implementing Custom Cursor (URGENT!)

Postby ffourcad » 15 Nov 2010, 07:57

Hello Everybody,

I want to add some custom cursor to my game, but on walkable tiles, it seems that it's not possible. Maybe OpenSpace is overriding or preventing this kind of feature. On non walkable tiles, it works (talk to NPCs for example).
Please answer me as soon as possible, we should release the game by the end of the week.

Thanks in advance.
TiagoR
Posts: 83
Joined: 15 Mar 2010, 11:42
Location: Portugal
Contact:

Postby TiagoR » 17 Nov 2010, 07:42

Hi
I think that for what you want to achieve you need assign a ROLLOVER trigger to your walkable tile skin in the OpenSpace Editor, and the event listener in your code that would set your custom mouse cursor.
TR
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Postby ffourcad » 17 Nov 2010, 09:52

thanks, I thought about it, but the custom cursor system I created is very generic, with classes extending MovieClip, and Singleton for storing specific cursor assets, so it is not really what I wanted.
I just wanted to understand, why a rollover event on a MovieClip used as a skin on a walkable tile was not working, whereas it does on non-walkable tiles.
Could you give me an answer to this last question, please?
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 17 Nov 2010, 15:33

ffourcad wrote:thanks, I thought about it, but the custom cursor system I created is very generic, with classes extending MovieClip, and Singleton for storing specific cursor assets, so it is not really what I wanted.
I just wanted to understand, why a rollover event on a MovieClip used as a skin on a walkable tile was not working, whereas it does on non-walkable tiles.
Could you give me an answer to this last question, please?

The reason is that another invisible movieclip is placed on walkable tiles above the skins, so it catches the mouse event before the skin does.
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Postby ffourcad » 18 Nov 2010, 15:55

so there is indeed no way to go around this. But I thought there was a way in flash to catch an event, but not interrupt the event flow, so other objects/class can catch the same event. Am I wrong ?
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 18 Nov 2010, 15:58

Not in this case.
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Postby ffourcad » 18 Nov 2010, 19:17

The solution proposed by Tiagor earlier is not working either : the roll_over event on skin is hardly ever triggered (but sometimes, which is really confusing).

I REALLY need to have interaction with walkable tiles !!!
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 19 Nov 2010, 12:15

Could you describe what are you trying to achieve? Please describe your scenario.
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Postby ffourcad » 19 Nov 2010, 13:25

there are some tiles on the street, on which i can walk, and where I have some garbages. when I drag my mouse over the garbage, I'd like to have a special cursor appearing (a grab icon instead of the mouse).
Then when I click on the garbage, the avatar goes to this tile, and the garbage disappear, as if he had picked it up.
Now the tile is empty, but still walkable of course.

In this scenario, I can't get the rollover event i have put on the garbage MovieClip, nor get the openSpace skinRollOver event, nor get the click on the garbage.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 22 Nov 2010, 08:13

Put a roll over trigger on the tile instance containing the garbage skin, not on the skin itself.
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Postby ffourcad » 22 Nov 2010, 13:26

but I'll have to do that for every tile in my 55x52 map. It's a lot of tiles to set up, and I'm afraid it will slow the game, with to many triggers on map.
Won't it ?
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 26 Nov 2010, 15:39

Triggers are not a big issue (OpenSpace v1 fired movement events continuously), but it is a lot of work to add triggers to all those tiles, yes.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 15 guests