Custom cursors in TyranoBuilder (default and active : menus, clickable areas, etc.)

Here's how I manage to have my own custom cursors in TyranoBuilder.

  • Where are the files ?

When you create a new game in TyranoBuilder, a new folder with the name of your game is created in \TyranoBuilder\myproject\, that's where are the files to tweak.

  • How to set a custom default cursor ?

The default cursor.

It's when your cursor is not changed in-game with Tyrano-scripting (we will see that later) nor hover a clickable area.

Easy : This one can be changed directly in the game settings of TyranoBuilder.

  • How to set a custom active cursor ?

By default, the active cursor is the pointer

The active cursor is when the cursor is over a clickable area, a menu etc.

First, search for this file : \TyranoBuilder\myproject\*YourGameName*\tyrano\plugins\kag\kag.tag.js
Edit it with any notepad or file editor you may have.
Then, find and replace any pointer by what you want as a cursor. It can be a native cursor (like Help for example) or an image you created typing url(), we'll see that later.

Then, do the same here \TyranoBuilder\myproject\*YourGameName*\tyrano\tyrano.css

  • What are the different options of cursor I can use ?

You can use native cursors like Help, Progress, Wait, Move.

The help cursor

The move cursor

You can set an image as well, the size you want with the url() CSS function.
Here how it works :
url(/data/image/my_cursor.gif) 4 12, auto
Means that you're searching for my_cursor.gif, that is stored in /data/image/
4 12 is optional it means that you define where the hotspot is, if nothing is written there it will be 0,0 and it's totally fine.
auto is the switch by default if the image is not found, advice : you should put here a native cursor, auto is more than fine.
  • How to change a cursor in-game for a special event ?

You can use the TyranoScript [cursor storage="my_cursor.gif"] and then set back the cursor storage to default.