我知道如何在SpriteKit
中添加Button。如何在SpriteKit中添加突出顯示的按鈕?
我已用SKSpriteNode
完成。 但是我不知道如何添加突出顯示按鈕,如UIButton
。
我的意思是當我按SKSpriteNode(Button)
,我想從UIKit顯示像UIButton
高亮顯示的圖像。
我該怎麼做?
這裏是我的代碼Button
與SKSpriteNode
。
self.playButton = [SKSpriteNode spriteNodeWithImageNamed:@"playButton.png"];
self.playButton.position = CGPointMake(self.frame.origin.x + 400, 100);
self.playButton.name = @"playButton";
self.playButton.zPosition = 2;
[self addChild:self.playButton];
這個代碼從場景的作品?如果我需要單獨的課程的按鈕按鈕? –
看看這個http://stackoverflow.com/questions/19082202/setting-up-buttons-in-skscene –
希望它有助於:) –