例如我有FlxText对象
(true)
我可以在我的应用程序中显示unicode符号,例如" 1" ,使用
protocol RecordViewDelegate: class {
func didTapRecord()
func didTapStop()
}
@IBDesignable
class RecordView: UIView {
@IBInspectable
var borderColor: UIColor = .clear { didSet { layer.borderColor = borderColor.cgColor } }
@IBInspectable
var borderWidth: CGFloat = 20 { didSet { layer.borderWidth = borderWidth; setNeedsLayout() } }
weak var delegate: RecordViewDelegate?
var isRecordButton = true
private var fillView = UIView()
private var containerView = UIView()
override init(frame: CGRect) {
super.init(frame: frame)
configure()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
configure()
}
private func configure() {
fillView.backgroundColor = .red
self.addSubview(containerView)
containerView.addSubview(fillView)
}
private var radius: CGFloat { return min(bounds.width, bounds.height) / 2 - borderWidth }
override func layoutSubviews() {
super.layoutSubviews()
containerView.frame = bounds
fillView.frame = CGRect(origin: CGPoint(x: bounds.midX - radius, y: bounds.midY - radius),
size: CGSize(width: radius * 2, height: radius * 2))
fillView.layer.cornerRadius = isRecordButton ? radius : 0
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
UIView.animate(withDuration: 0.25) {
self.fillView.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
self.fillView.backgroundColor = UIColor(red: 0.75, green: 0, blue: 0, alpha: 1)
}
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
if let touch = touches.first, containerView.bounds.contains(touch.location(in: containerView)) {
if isRecordButton {
delegate?.didTapRecord()
} else {
delegate?.didTapStop()
}
isRecordButton = !isRecordButton
}
UIView.animate(withDuration: 0.25) {
self.fillView.transform = .identity
self.fillView.backgroundColor = UIColor.red
self.fillView.layer.cornerRadius = self.isRecordButton ? self.radius : 0
}
}
}
但我无法显示unicode符号(来自相同的字体),例如
var t:FlxText=new FlxText();
然后我将我的项目编译为cpp debug并且无法看到mount_fuji符号。只有方框。 我怎么了? :)
在win7 64上测试了代码。
代码是使用FontForge programm。任何帮助都会很好