RMSpriteButton 1.2

RMSpriteButton 1.2

测试已测试
语言语言 SwiftSwift
许可协议 MIT
发布最后发布2017年6月
SwiftSwift 版本3.0
SPM支持 SPM

Roger Molas 维护。



RMSpriteButton

SpriteKit 类似的 UIButton 控件,它使用背景图进行选中状态和突出显示。

安装

RMSpriteButton 可以通过 CocoaPods 获取。要安装,只需将以下行添加到您的 Podfile 中:

pod "RMSpriteButton"
let button = RMSpriteButton(title: "My Title", backgroundColor: UIColor.blueColor())
    button.size = CGSizeMake(200, 100)
    button.addTarget(self, selector:Selector("call:"), object:self)
    button.position = CGPoint(x:CGRectGetWidth(self.frame) / 2, y:CGRectGetHeight(self.frame) / 2);
    self.addChild(button)
```

## Using background image
```swift
let button = RMSpriteButton(image: "test_button")
    button.size = CGSizeMake(200, 100)
    button.addTarget(self, selector:Selector("call:"), object:self)
    button.position = CGPoint(x:CGRectGetWidth(self.frame) / 2, y:CGRectGetHeight(self.frame) / 2);
    self.addChild(button)

作者

rogermolas,[email protected]

许可协议

MIT 许可协议 (MIT)

版权所有 © 2017 Roger Molas

本软件及相关的文档文件(以下简称“软件”)的副本,任何人不经许可均可免费获取,并准许免费的软件处理,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售复制品,并准许获得软件的人员进行上述操作,前提是满足以下条件:

上述版权声明和许可声明应包括在软件的各个副本或主要部分中。

软件“按现状”提供,不附带任何明示或暗示的保证,包括但不限于对商业性、针对特定用途的适用性和非侵权性的保证。在任何事件中,作者或版权所有者对任何索赔、损害或其他责任(无论基于合同、侵权或其他),由于、从或与软件或其使用或其他操作相关,均不承担责任。