Professional Documents
Culture Documents
Become - Unity 2d Graphical Elements PDF
Become - Unity 2d Graphical Elements PDF
Become - Unity 2d Graphical Elements PDF
Assets Resources you can use in your Texture Inspect an image asset to change its Sprite Select the Sprite Asset > click Sprite
game. Images (bmp, tif, tga, jpg, modes Texture Mode. "Sprite (2D and UI)" Editor Editor in the Inspector. Allows the
psd), models (fbx, max, blend, mb, is the default mode for images in 2D extraction of single sprites from
ma), meshes, audio projects. "Texture" is the default for spritesheets (be sure to set the Sprite
images in 3D projects. "Texture" Mode of your asset to "Multiple"
Standard Basic assets that either ship with
assets Unity installation or can be assets are meant to be drawn on 3D before). In the editor you can access
models, "Sprite"s are meant to be the Slice menu at the top left, which
downloaded from the Asset Store
standalone 2D images allows you to separate the images
Asset Library of free and paid
automatically. Unity will draw a crop
Sprites Image file containing severa sub-
Store downloadable assets (textures,
rectangle outside each image. You
heet images on a transparent
models, animations, project
can select them to tweak properties
background. Ex: image containing all
examples, editor extensions,
frames for a 2D animation. When and to set the name with which that
tutorials). Access from the editor:
importing a spritesheet as an asset, Sprite will be exported. Click Apply to
Window > General > Asset Store
confirm, Revert to discard. You can
set (in the Inspector) Sprite Mode to
Asset Archive of assets that can be also use the Sprite Editor to change
"Multiple"
package imported in your project. Can be polygons (placeholder sprites)
standard (supplied with Unity) or Sprite 1) Creator (creates placeholder
becomeagamedeveloper.github.io/site
Unity 2D Graphical Elements Cheat Sheet
by Become A Game Developer (become) via cheatography.com/67591/cs/17128/
UI UI (cont) UI (cont)
UI Graphical User Interface element RectTra Component used for UI Elements in Text Label displaying some text
Element (text labels, buttons, on-screen nsform place of the Transform, to set Image Displays a Sprite Asset. You
sprites, health bars, ammo count, position, rotation, scale, width &
can change colors and Image
sealthometers, etc). Represented by height of the rectangle, Pivot,
Type (how the Sprite will
Game Objects with particular kinds Anchor
appear inside the UI Rectangle)
of Components
Pivot Point around which rotations and Rect Mask Restricts the children elements
Canvas Game Object with a Canvas scaling occur. Shown as a blue ring. 2D to the shape of this element
component. All UI Elements should It can be moved with the mouse if
(parent)
be children of it. Shown as a the editor's toolbar pivot button is
API
rectangle in the Scene. Double click set to "Pivot" mode. Or it can be set
on it in the Hierarchy to focus the when choosing the Anchor preset Reference UI Components are exactly like
Scene on it from the RectTransform by keeping UI other Components. For each of
SHIFT presesd Components them, there exists a class with
Create From editor: Game Object > UI >
the same name, that you can
UI (choose the one you want). Or from Anchor Shown as 4 small triangular
use as a type to store a
Element the Hierarchy: Right click > UI > handles. It represents the point (of
reference to the Component in
(choose one). If a Canvas is not this element's parent UI Element) to
present, it will be automatically which this element is anchored: if Scripts.
created, and the UI Game Object will that point moves (when modifying Ex: public Text myLabel;
be added as a child the parent's RectTransform) this myLabel. Access the text member to
element (child) will move
Draw Elements on Canvas are drawn in text = change a label's text. You can
accordingly. Can be set by choosing
order the same order in which they appear _cur + " set it to any string. You can
in the Hierarchy an Anchor preset from the concatenate strings and values
/ " +
RectTransform. You can also set the using +
Rect Tool in the editor toolbar used to _max + "
4 triangles apart. This will make the
Tool manipulate the size of UI Elements
child stretch when the parent is HP";
(all being represented as
resized
rectangles) UI manual:
UI Visual Components https://docs.unity3d.com/Manual/UISystem.html
becomeagamedeveloper.github.io/site