Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: StillInThe90s on Thu 20/02/2014 13:18:16

Title: [SOLVED] Ways to manipulate iItem.CursorHotspot ?
Post by: StillInThe90s on Thu 20/02/2014 13:18:16
Is there a way of setting a cursor hotspot in-code, equivalent of "iItem.CursorGraphic=123"?

I am using two different sprites for an inventory object and its cursor. The "Use selected inventory graphic for cursor" -mode is on.
Setting "CursorGraphic" seems to center its hotspot instead of keeping the one set in the editor. (Oops! Guess I was wrong about this. It keeps the editor settings.)
Workaround, anyone (other than having a huge cursor sprite)?

Thanks.
Title: Re: Ways to manipulate iItem.CursorHotspot ?
Post by: Khris on Thu 20/02/2014 13:29:22
Try
mouse.ChangeModeHotspot(eModeUseinv, x, y);
Title: Re: Ways to manipulate iItem.CursorHotspot ?
Post by: StillInThe90s on Thu 20/02/2014 13:31:53
Would that change the actual hotspot or do I have to call this when the inv item is selected?

Edit: I got it semi-working. Looks like it will work one it's integrated with global script.

Thanks Khris!
Title: Re: Ways to manipulate iItem.CursorHotspot ?
Post by: Khris on Thu 20/02/2014 14:38:32
You have to call this whenever an item is selected and whenever you change an item's cursor graphic I guess.
Title: Re: Ways to manipulate iItem.CursorHotspot ?
Post by: StillInThe90s on Thu 20/02/2014 15:05:37
Yup. Seems to be working. Thanks again.