Gamedev:MouseCursors: Difference between revisions

From Spring
Jump to navigationJump to search
Jk (talk | contribs)
restructure
Jk (talk | contribs)
No edit summary
Line 1: Line 1:
=Mouse Cursors=
=Mouse Cursors=
==Location==
==Location==
Cursors for Spring are stored in the <code>Anims</code> directory.
Cursors for Spring are stored in the <code>Anims/</code> directory.


==Supported Image Formats==
==Supported Image Formats==
Line 11: Line 11:


==Filename==
==Filename==
Even if your cursor isn't animated, it must have the _0 at the end of its name.  
Even if your cursor isn't animated, it must have the _0 at the end of its name.
Only when using a .txt this isn't needed.


==Animated Cursors==
==Animated Cursors==
To make animated cursors, just make a sequence where the filenames start with '_0' at the end of the first in the sequence, going on sequentially until the last frame.
===Via Filenames===
To make animated cursors, just make a sequence where the filenames start with '_0' at the end of the first in the sequence, going on sequentially until the last frame. This uses the default `frame time` (= the time each sprite is visible) of 0.1sec.
 
===Via .txt===
You can also create a .txt file with further specifications for your cursor:
 
<code>cursorattack.txt:</code>
<code><pre>
hotspot %hotspot
frame %filename_0 %timespan_0
frame %filename_1 %timespan_1
frame %filename_2 %timespan_2
...
lastframe %i
</pre></code>
Neither the <code>hotspot</code> nor the <code>lastframe</code> tag are needed.
The <code>hotspot</code> can either be "topleft" or "center".
Note, the filenames have to contain the full path, e.g. <code>Anims/CursorMove.png</code>.


==Default Cursors==
==Default Cursors==

Revision as of 03:32, 25 February 2011

Mouse Cursors

Location

Cursors for Spring are stored in the Anims/ directory.

Supported Image Formats

The cursors have to be in either:

  • png
  • tga
  • bmp

To make transparent sections in bmp's use RGB(84, 84, 252).

Filename

Even if your cursor isn't animated, it must have the _0 at the end of its name. Only when using a .txt this isn't needed.

Animated Cursors

Via Filenames

To make animated cursors, just make a sequence where the filenames start with '_0' at the end of the first in the sequence, going on sequentially until the last frame. This uses the default `frame time` (= the time each sprite is visible) of 0.1sec.

Via .txt

You can also create a .txt file with further specifications for your cursor:

cursorattack.txt:

hotspot %hotspot
frame %filename_0 %timespan_0
frame %filename_1 %timespan_1
frame %filename_2 %timespan_2
...
lastframe %i

Neither the hotspot nor the lastframe tag are needed. The hotspot can either be "topleft" or "center". Note, the filenames have to contain the full path, e.g. Anims/CursorMove.png.

Default Cursors

All cursors must also be present in one form or another, even if they are not used by your mod or else Spring will whine. Here's a list of the various cursor names used in the game:

Sequence name Description
cursorattack_0 Attack Command Cursor
cursorcapture_0 Capture Command Cursor
cursordefend_0 Guard Command Cursor
cursormove_0 Move Command Cursor
cursornormal_0 Default (unactive) cursor
cursorpatrol_0 Patrol Command Cursor
cursorpickup_0 Load Command Cursor
cursorreclamate_0 Reclaim Command Cursor
cursorrepair_0 Repair Command Cursor
cursorrevive_0 Revive (resurrect) Command Cursor
cursorunload_0 Unload Command Cursor