:title Sprite Manager

:label spriteManager


** Contents **~~
<<spriteManager#startup|Startup>>~~
<<spriteManager#spriteCollection|Sprite Collection>>~~
<<spriteManager#graphicsData|Graphics Data>>~~
<<spriteManager#spriteData|Sprite Data>>~~
<<spriteManager#spriteBaseData|Sprite base data>>~~
<<spriteManager#spriteActionAnimation|Sprite Action and Animation>>~~
<<spriteManager#spriteExport|Export>>~~


:anchor startup
The sprite manager enables you to collect different animation sequences of images to an action and a direction under the hood of labeling it "sprite".

The field of control is similar to the tile manager: 


:image SpriteManager1.png|Sprite Manager|fileopen


The Screen is divided (again) into 4 sections:~~
1) Top ~~
In the top section the sprite management stuff is shown. SpriteSets can be loaded saved and divided into classes.

2) Left Side~~
On the left side you can see the current loaded SpriteSet displayed with the corresponding graphics. You can select the images using the mouse button.

2) Middle Top~~
Here you can set a graphic for your sprite(s). Input for the graphic is an ImageCollection.

2) Middle Bottom~~
Here you can enter all information you might associate with sprites. Like a name, ID, height and width restrictions, descriptions, a set of attributes etc.
~~Not done yet: Sprite attributes.

:h2 File
What is "File"?
A SpriteSet is saved to a simple (xml) file, which includes all information about the SpriteSet.
The ". . ."-Button opens a file dialog do open a SpriteSet. To save to a new SpriteSet you MUST enter a filename.
Some operations to are only possible if a filename (and a class) is given.

:h2 Class (es)
Each SpriteSet can (must) be divided (at least one) into classes. 
All classes and all information in those classes are saved into one (xml) file (see above). 
To allow distinguishing tiles in one SpriteSet, you can also give each sprite a specific class. All sprites that have the same class in one SpriteSet are displayed together.~~
E.g.~~
Filename:~~
____Human (the SpriteSet will be saved to a file in directory "xml/Sprite" named "Human.xml")~~
Classes:~~
____Monster~~
____Animals~~
etc.~~
Some operations to Sprites / SpriteSets are only possible if a class (and a filename) is given.

:h2 Sprite Collection
:anchor spriteCollection
:image SpriteCollection.png|Sprite Collection|fileopen
The current loaded Sprite Collection is displayed on the left side of the window.
You can select a sprite using the mouse (clicking). 
To add / remove a sprite click the appropriate buttons. Add overwrites any sprite in the collection with the same name.

The "new sprite" button does as it is labeled.

**Attention**~~
The name of a sprite must be unique within one SpriteCollection. Even sprites in different classes in the same SpriteCollection //must// have different names! Otherwise the "other" sprite will be overwritten.~~
BTW. this allows "easy" transfer of sprites from one class to another class within one SpriteCollection -> just change the classname and save the SpriteCollection!


:h2 Graphics Data
:anchor graphicsData
:image SpriteGraficsData.png|Sprite graphics data|fileopen

When you build a new sprite or SpriteSet you usually start with the graphical representation of the sprite. ~~
In graphics data area, you can load (previously defined) ImageCollections. You must give the corresponding filename of the ImageCollection followed by the class of ImageSequences you would like to see in that collection.~~
All ImageSequences are displayed in a horizontal stripe (scrollable). By clicking you can "activate" the clicked ImageSequence. Some data will be displayed.~~
To set a selected ImageSequence to the current sprite see help for "Actions & Animations" tab.


:h2 Sprite Data
:anchor spriteData
The data section for sprites is divided into 2 tabs:

**Sprite base data**~~
:anchor spriteBaseData
:image SpriteTab1.png|Sprite Tab 1|fileopen
Which is very similar to the first tab of tile data.~~
Attributes are not supported yet.


** Note**~~
Some changes are only activated after you press "add sprite" button.
This will certainly change in some future - but as of now it is as it is. 
Alle sprite data from the GUI is than parsed and added correctly to internal structures and saved to memory.

Aptly named the button should be called "update internal sprite data".
The data is **NOT** saved to a storage device. In order to do that you have to press "Save SpriteSet"!

Just rememeber if changes you made to a sprite which are not visble yet -> once press the "add sprite" button, and everything should be fine!




**Action & Animations**~~
:anchor spriteActionAnimation
:image SpriteTab2.png|Action & Animations|fileopen

:h4 Action
This is a editable Combobox. You can add new actions to a sprite by writing its "action name" into the combobox and pressing enter.

Directly below you see empty square boxes. Into these boxes you drag and drop (from the image data section) the animations for each direction for the provided action.~~

(after "add sprite")
You can select each animation and it will be visible in its animations stages on the left side of the label "selected animation".

To remove a animation, select it and press "remove selected".

:h4 Selected Animation
For each sequence of the animation you can give the action a delta movement. Coordinates are given as X and Y delta values.
Positive delta values means "go right" or "go down", negative values "go left" or "go up".

:h4 Subsequent Action
Each action can have a subsequent action (which allways has the same direction as the original).
For example after the action "Attack" the next action might be "Run".
For looping the same action tag the corresponding checkbox (e.g. Run).

:h4 Animation test
On the left side you see a little squared box, there you can preview the current selected action. 
The delta movements will be considered. The sprite may run "out of the box". If you wish to compensate that check the "Out of bounds" checkbox. If the sprite moves out of bounds it will "reappear".

:h4 Additional features
Below the "remove selected" button there are som additional features a sprite may have:~~
a) Steps absolut~~
If enabled the delta steps a sprite makes are NOT scaled when the sprite is scaled. Meaning "tiny sprites" may make huge steps... (vice / versa)
b) enable automatic movement~~
If this enabled, the delta movement information is used to move a sprite. Otherwise the sprite must be moved by some "outer" means.
c) enable updates when not in viewport~~
If enabled, a sprite is ALLWAYS updated, regardless whether it is currently in visible in the viewport (of a map) or not.
(moving sprites should be allways updated, otherwise they can not "appear" in the viewport, fixed sprites may not need an update if not visible)
d) back shadows~~
:image BackShadow.png|BackShadow|fileopen
:image NoBackShadow.png|No BackShadow|fileopen 
The backshadow can be configured via:
1) Thickness
2) color
3) and the antialiase 



:h2 User export
:anchor spriteExport

Not done yet!
















