Forum rules - please read before posting.

Custom cursors in different scenes

Does anyone know if it is possible to have the main cursor be different depending on what scene you are in?  Is there any way either by Action List or by code?  I've looked through the scripting guide and the CursorManager doesn't seem to have anything that can change the main cursor.  I've only managed to change interaction cursors.

Also, on a somewhat related note, is there a way for all of the dialogue options area to have a custom cursor when hovering over the whole area instead of only when hovering over a dialogue choice?  If there is a way in code of fixing the first question then this one should be doable in a similar way.

Thanks in advance for any help!

Comments

  • edited August 2016
    If you right-click on your Main cursor texture field in the Cursor Manager (just as with any Manager field), you can get the API reference to change that reference through script:

    KickStarter.cursorManager
    .pointerIcon
    .texture

    You can then manipulate this field in a custom script.  Be aware that as this will change the Cursor Manager asset file, you will also need to set the texture to it's "default" value when the game starts.

    There is no option within the Menu Manager to change the cursor's icon over individual slots, so if you want to change the icon you'll need another script to read if the cursor is over a given slot.  The Menu class has a function that can do this: IsPointerOverSlot.

    The "point" parameter will be the location of the mouse, inverted for use with OnGUI calls:

    KickStarter.playerInput.GetInvertedMouse ()

    A Menu class can be accessed with the PlayerMenus.GetMenuWithName static function.  There is a similar function for getting a MenuElement class.
  • The right-click thing doesn't seem to work for me, but this is exactly what I was looking for.  Thank you very much for your help!
  • On PC or Mac?  Most refernces are accessed by right-clicking the field's label, but in the case of the texture slot it needs to be on the texture field itself.
  • Ummm, I want to do something similar but I want the cursors to animate. How would I go about playing the new texture's related animation at runtime? I've never used animated cursors, but I'm guessing it's a sprite sheet or something? Does it animate by default if I pass a spritesheet as the new texture?
  • There are some internal variables in the CursorIcon class that determine whether a cursor is animated, the first being isAnimated.  The variables for the rows, frames, and columns are also listed beneath it in the scripting guide.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.