SpriteKit 自定义图片按钮

时间:2022-03-24 10:28:22
【文件属性】:

文件名称:SpriteKit 自定义图片按钮

文件大小:44KB

文件格式:ZIP

更新时间:2022-03-24 10:28:22

SpriteKit 按钮 Button

Example: ButtonSpriteNode *_fight = [[ButtonSpriteNode alloc] initWithImageName:@"fire_btn1.png" selected:@"fire_btn2.png" disable:@"fire_btn3.png"]; _fight.position = CGPointMake(self.frame.size.width/2, self.frame.size.height/2); [_fight setMethod: ^ (void) { NSLog(@"fighting"); } ]; [self addChild:_fight]; Button selected: _fight.selected = Yes; Button disable: _fight.disable = Yes; setText: [_fight setLabelWithText:@"fighting" Font:[UIFont systemFontOfSize:18.0f] Color:[UIColor colorWithString:@"#fff"]];


【文件预览】:
ButtonSpriteNode
----.git()
--------lfs()
--------index(313B)
--------ORIG_HEAD(41B)
--------hooks()
--------config(403B)
--------description(73B)
--------refs()
--------logs()
--------objects()
--------info()
--------COMMIT_EDITMSG(16B)
--------HEAD(23B)
--------FETCH_HEAD(104B)
----ButtonSpriteNode.m(4KB)
----README.md(635B)
----ButtonSpriteNode.h(700B)

网友评论