[client] rename frame => view

This commit is contained in:
2019-03-21 20:26:28 +03:00
parent 0b17fbf804
commit 4d8de90419
43 changed files with 119 additions and 114 deletions

View File

@@ -0,0 +1,39 @@
package ru.m.tankz.view.common;
import openfl.Assets;
import haxework.gui.LabelView;
import haxework.gui.ImageView;
import haxework.gui.HGroupView;
@:template class LifeView extends HGroupView {
@:view("tank") public var tankImage:ImageView;
@:view("live") public var liveLabel:LabelView;
@:view("score") public var scoreLabel:LabelView;
public var tank(null, set):String;
public var color(null, set):Int;
public var live(null, set):Int;
public var score(null, set):Int;
private inline function set_tank(value:String):String {
if (value != null) {
tankImage.image = Assets.getBitmapData('resources/image/tank/${value}-0.png');
}
return value;
}
private inline function set_color(value:Int):Int {
tankImage.color = value;
return value;
}
private inline function set_live(value:Int):Int {
liveLabel.text = 'x${value}';
return value;
}
private inline function set_score(value:Int):Int {
scoreLabel.text = '${value}$';
return value;
}
}