TRIMMED Select this option will set the size of the node to use trimmed image size of the current SpriteFrame used by Sprite component. Size Mode Use the options in this property to set node's size to the original texture size or trimmed image size. If unchecked the bounding box will be showing original texture including transparent pixels. Instead the bounding box will be an exact fit to trimmed image. Trim If checked, the node's bounding box will not include transparent pixels around the image. There are two properties related to trim setting in Sprite component: Trim Related Properties in Sprite Component When the SpriteFrame is auto-trimmed, the auto-trimmed information in the image below is grayed out and cannot be modified: This will help us get the exact node size we need for Sprites. Any fully transparent pixels around the image will be cropped. Once a texture is imported, the SpriteFrame asset generated with the texture will be trimmed automatically. Native engine memory leak detection system Getting Started Example - First Data InteractionĬalling the Engine API and Project Script Resource Management Considerations - meta files Please do not use Crop, flush position, or the trim information will be lost and you can't get back originial texture offset anymore.Cocos Creator 3.5 Native Built Project Upgrade Guideīuild a Scene Image Using the Scene PanelĬustom Materials for 2D Rendering ObjectsĭragonBones ArmatureDisplay Component ReferenceĬreate a List of Dynamically Generated ContentĬreating Animation Components and Animation Clips In TexturePacker before you publish your sprite sheet, please make sure you choose Trim in Trim Mode setting of Sprites section. We recommend users to use sprite sheet tools such as TexturePacker for generating sprite animation texture assets. If Trim property is set to true, it would fit animations that have no in texture offset. So that the character's position drawn in the texture can be displayed correctly. In this way, the animation will use the original texture size when playing each sequence frame, and retain the information of transparent pixels around the image. In this case, we need to set the Sprite component's Trim property to false, and set the Size Mode to RAW. Usually animator will use a large texture and put character on different positions on the texture for different animation frames. There are a lot of animator prefer to draw the moving motion in texture, commonly seen in attack animations. The following picture shows the comparison of two size modes: If you use the Rect Transform Tool to drag and drop to change the size of the node, or modify the size property in Properties panel, or modify the width or height in the script, the Size Mode property will be automatically set to CUSTOM. CUSTOM: This option make sure the size of the node will not be changed along with SpriteFrame, and should be managed by yourself.RAW: Select this option will set the size of the node to use the original texture size, including transparent pixels.TRIMMED: Select this option will set the size of the node to use trimmed image size of the current SpriteFrame used by Sprite component.Size Mode: Use the options in this property to set node's size to the original texture size or trimmed image size.It only takes effect when the Type is set to Simple. Trim: If checked, the node's bounding box will not include transparent pixels around the image.Resource management considerations - meta files
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |