Was running thought tutorials on using Toolkit HaxeUI with OpenFL and when compiled to Flash target doesn’t generate an error (as z is intrinsic possibly?) but when compiling to HTML5 target compile stops with error:
E:/Motion-Twin/Haxe/lib/haxeui/1,7,1/haxe/ui/toolkit/core/DisplayObject.hx:193: characters 2-11 : openfl.display.Sprite has no field z
Referring to this setter:
private function set_z(value:Float):Float {
_z = Std.int(value);
_sprite.z = _z; <!---- this doesn't exist on current display object in HTML5 context
return value;
}
------------------------------------------------------------
My installed libs:
actuate: [1.8.2]
box2d: [1.2.3]
haxeui: [1.7.1]
hscript: [2.0.4]
hxcpp: [3.2.27]
layout: [1.2.0]
lime: [2.1.3]
openfl-samples: [2.2.2]
openfl: [2.2.8]
svg: [1.0.8]
swf: [1.7.7]
unknown: [1.0.0]
yagp: [1.1.4]
---------------main class--------------------------
package ;
import haxe.ui.toolkit.core.Toolkit;
//import haxe.ui.toolkit.core.Root;
//import haxe.ui.toolkit.controls.Button;
//import haxe.ui.toolkit.events.UIEvent;
import haxe.ui.toolkit.themes.GradientTheme;
import openfl.display.DisplayObject;
import openfl.display.Sprite;
import flash.events.Event;
import flash.Lib;
import openfl.text.TextField;
import openfl.text.TextFormat;
import openfl.text.TextFormatAlign;
import openfl.text.TextFieldAutoSize;
class Main extends Sprite
{
var inited:Bool;
private var scoreField:TextField;
private var messageField:TextField;
function resize(e)
{
if (!inited) init();
// else (resize or orientation change)
}
function init()
{
Toolkit.theme = new GradientTheme();
Toolkit.init();
//Toolkit.init();
//Toolkit.openFullscreen(function(root:Root) {
//var b:Button = new Button();
//b.text = "Test button";
//b.x = 10;
//b.y = 10;
//root.addChild(b);
//
//b.addEventListener(UIEvent.CLICK, function(evt:UIEvent) {
//evt.component.text = "Clicked";
//});
//});
if (inited) return;
inited = true;
var scoreFormat:TextFormat = new TextFormat("Verdana", 24, 0xbbbbbb, true);
scoreFormat.align = TextFormatAlign.CENTER;
scoreField = new TextField();
addChild(scoreField);
scoreField.width = 500;
scoreField.y = 30;
scoreField.defaultTextFormat = scoreFormat;
scoreField.selectable = false;
var messageFormat:TextFormat = new TextFormat("Verdana", 18, 0xbbbbbb, true);
messageFormat.align = TextFormatAlign.CENTER;
messageField = new TextField();
addChild(messageField);
messageField.width = 200;
messageField.y = 350;
messageField.x = 500;
messageField.defaultTextFormat = messageFormat;
messageField.multiline = messageField.wordWrap = true;
messageField.autoSize = TextFieldAutoSize.CENTER;
messageField.selectable = false;
messageField.text = "A message to the user to help them. What they should do";
// code
this.addEventListener(Event.ENTER_FRAME, everyFrame);
}
private function everyFrame(event:Event):Void {
}
public function new()
{
super();
addEventListener(Event.ADDED_TO_STAGE, added);
}
function added(e)
{
removeEventListener(Event.ADDED_TO_STAGE, added);
stage.addEventListener(Event.RESIZE, resize);
#if ios
haxe.Timer.delay(init, 100); // iOS 6
#else
init();
#end
}
public static function main()
{
// static entry point
Lib.current.stage.align = flash.display.StageAlign.TOP_LEFT;
Lib.current.stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
Lib.current.addChild(new Main());
//
}
}