Format TexturePacker atlas changes
This commit is contained in:
@@ -237,8 +237,7 @@ class RuntimeNode {
|
|||||||
asset: _stringProp(props, RuntimeProtocolField.asset) ?? asset,
|
asset: _stringProp(props, RuntimeProtocolField.asset) ?? asset,
|
||||||
frame: _stringProp(props, RuntimeProtocolField.frame) ?? frame,
|
frame: _stringProp(props, RuntimeProtocolField.frame) ?? frame,
|
||||||
pressedFrame:
|
pressedFrame:
|
||||||
_stringProp(props, RuntimeProtocolField.pressedFrame) ??
|
_stringProp(props, RuntimeProtocolField.pressedFrame) ?? pressedFrame,
|
||||||
pressedFrame,
|
|
||||||
disabledFrame:
|
disabledFrame:
|
||||||
_stringProp(props, RuntimeProtocolField.disabledFrame) ??
|
_stringProp(props, RuntimeProtocolField.disabledFrame) ??
|
||||||
disabledFrame,
|
disabledFrame,
|
||||||
|
|||||||
@@ -371,7 +371,10 @@ Future<GamePackage> _createTextureAtlasPackage(String name) async {
|
|||||||
final hashAtlas = RuntimeTextureAtlas.fromJsonString(
|
final hashAtlas = RuntimeTextureAtlas.fromJsonString(
|
||||||
File('${root.path}/assets/ui.json').readAsStringSync(),
|
File('${root.path}/assets/ui.json').readAsStringSync(),
|
||||||
);
|
);
|
||||||
expect(hashAtlas.frames['button_idle.png']?.rect, Rect.fromLTWH(2, 3, 40, 20));
|
expect(
|
||||||
|
hashAtlas.frames['button_idle.png']?.rect,
|
||||||
|
Rect.fromLTWH(2, 3, 40, 20),
|
||||||
|
);
|
||||||
final arrayAtlas = RuntimeTextureAtlas.fromJsonString('''
|
final arrayAtlas = RuntimeTextureAtlas.fromJsonString('''
|
||||||
{
|
{
|
||||||
"frames": [
|
"frames": [
|
||||||
@@ -384,7 +387,8 @@ Future<GamePackage> _createTextureAtlasPackage(String name) async {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
''');
|
''');
|
||||||
final mergedAtlas = '''
|
final mergedAtlas =
|
||||||
|
'''
|
||||||
{
|
{
|
||||||
"frames": {
|
"frames": {
|
||||||
"button_idle.png": {
|
"button_idle.png": {
|
||||||
|
|||||||
Reference in New Issue
Block a user