feat(2d): support pixelsToUnit in SpriteFrame.reset - #203
Open
shrinktofit wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
@cocos-robot run test cases |
Code Size Check Report
Interface Check Report! WARNING this pull request has changed these public interfaces:
@@ -732,8 +732,14 @@
* 在图集中的精灵帧可能会被剔除透明像素以获得更高的空间利用李,剔除后的矩形尺寸比剪裁前更小,偏移量指的是从原始矩形的中心到剪裁后的矩形中心的距离。
*/
offset?: math.Vec2;
/**
+ * @en Number of pixels corresponding to unit size in world space.
+ * @zh 世界空间中的单位大小对应的像素数量。
+ * @default 100
+ */
+ pixelsToUnit?: number;
+ /**
* @en Top side border for sliced 9 frame.
* @zh 九宫格精灵帧的上边界。
* @default 0
*/
@@ -1156,9 +1162,9 @@
* @en clone a sprite frame.
* @zh 克隆当前 sprite frame。
*/
clone(): SpriteFrame;
- protected _refreshTexture(texture: __private._cocos_asset_assets_texture_base__TextureBase): void;
+ protected _refreshTexture(texture: __private._cocos_asset_assets_texture_base__TextureBase, updateMesh?: boolean): void;
/**
* @en complete loading callback.
* @zh 加载完成回调。
* @deprecated since v3.7.0, this is an engine private interface that will be removed in the future.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re: #
This gives callers an opportunity to set pixels per unit when initializing a
SpriteFramethroughreset(), for example when creating sprite frames directly in tests. Unity'sSprite.Createsimilarly accepts apixelsPerUnitargument at sprite creation time.Changelog
pixelsToUnitthroughSpriteFrame.reset().Continuous Integration
This pull request:
Compatibility Check
This pull request: