Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gdevelop:documentation:manual:built_sprite [2015/05/18 12:28] (current)
Line 1: Line 1:
 +====== Sprites ======
 +
 +Sprite objects consist of images and animations and are very popular in games: Sprites can display a large variety of game components such as characters, platforms and user interface elements..\\
 +Each animation can represent for example a state of the object (running, walking, exploding...). An animation is itself composed of directions, corresponding to the angle of the object (looking left, right, etc...).
 +
 +===== Editing sprites =====
 +
 +All the objects in a scene are listed in the [[edit_object|Object Editor]],
 +on the screen right-side. Double-clicking on a Sprite object opens a pop-up from where you can edit sprites:
 +
 +{{ gdevelop:​documentation:​manual:​spriteediting.png?​nolink |}}
 +
 +==== Animations ====
 +
 +Animations are displayed in the Animations panel, on the left by default.\\
 +A default animation exists when a Sprite object is created:
 +
 +{{ gdevelop:​documentation:​manual:​defaultanimation.png?​nolink |An object always have at least an animation.}}
 +
 +To add a new animation, just click on the first button of the toolbar. You can also make a right click on an already existing animation and choose "Add an animation"​.
 +{{ gdevelop:​documentation:​manual:​addbutton.png?​nolink |}}
 +
 +To edit a specific animation, just select it, and its images will be displayed in the Images panel.
 +
 +==== Images ====
 +
 +When an animation is chosen, its images are displayed in the Images panel.
 +You can add or remove an image by making a right click in this panel:
 +
 +{{ gdevelop:​documentation:​manual:​imagespanelmenu.png?​nolink |}}
 +
 +You can set the interval between each image, and specify if the animation should loop, using the toolbar of the Animation panel :
 +
 +{{ gdevelop:​documentation:​manual:​timebetweenframesandloop.png?​nolink |}}
 +
 +If you want to see a preview of the animation, just click on the preview button:
 +{{ gdevelop:​documentation:​manual:​previewbutton.png?​nolink |}}
 +
 +==== Points ====
 +
 +Points allow to specify special positions on objects (Like the motor for a vehicle, the gun for a soldier...)
 +Each image can have one or more points. Points can be edited by clicking on the first button of the center toolbar:
 +{{ gdevelop:​documentation:​manual:​editingpointsbutton.png?​nolink |}}
 +
 +When editing points, the following window will popup. It displays the list of the points:
 +
 +{{ gdevelop:​documentation:​manual:​editingpoints.png?​nolink |}}
 +
 +Select an point in the list to display it on the image. You can then click on the image to move the point.
 +
 +==== Collision masks ====
 +
 +You can test whether objects are colliding with conditions in the **//All objects//** category.
 +Collision detection works with //collision masks// ( also called //Hit boxes// ). Collision masks are, by default, a single invisible rectangle with the size of the object. You can customize collision masks for your object by click on this button in the toolbar:
 +
 +{{ gdevelop:​documentation:​manual:​editingcollisionmaskbutton.png?​nolink |}}
 +
 +When editing collision masks, the following window will popup. It displays the list of the collision masks:
 +
 +{{ gdevelop:​documentation:​manual:​editingcollisionmasks.png?​nolink |}}
 +
 +You can add a new rectangle by clicking on the first button of the toolbar.
 +Masks are displayed on the image, and they can be moved by dragging them. You can also make a double click on a mask in the list to enter its coordinates.