[client] rename frame => view
This commit is contained in:
39
src/client/haxe/ru/m/tankz/view/common/LifeView.hx
Normal file
39
src/client/haxe/ru/m/tankz/view/common/LifeView.hx
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user