I do not know what’s going on with my Haxe project, but every other project works and renders correctly while this one simply refuses to render images and text.
I’ve got a pastebin here with the main entry point at the top.
Could someone tell me what exactly I’m doing wrong?
The following libraries I am using are as follows:
You should load a font from assets and set embed to true
I also recommend to use the autosize option (in your project it is truncated now and selectable)
here’s the code for MenuBar (put a font in the assets as well!)
import openfl.text.TextFieldAutoSize;
[...]
var font = Assets.getFont ("assets/thefontyouwant.ttf");
_title = new TextField();
_title.defaultTextFormat = new TextFormat(font.fontName, 16, 0xFF0000, true);
_title.autoSize = TextFieldAutoSize.LEFT;
_title.embedFonts = true;
_title.selectable = true;
_title.wordWrap = false;
_title.border = false;
_title.text = Text;
[...]
Thank you for your help, but unfortunately that did not solve my problem. I have changed my TextField to embed fonts, used both my Fonts class and your method, and neither changed the “missing objects” problem that I am encountering.
The objects are added but nothing appears. I am aware of setting the “width” and “height” properties of sprites, and using scaleX and scaleY would fix the rendering issues, but I thought that was only AFTER the object had been added to the scene/stage. So - once again - I’m baffled as to what the problem is.
If you comment this line in your project it works.
Not entirely sure why actually.
But it looks like you scale the Sprite (I’ve tried to draw on graphics a square and it was scaled, looking like a long rectangle)
Sorry if I mislead you before.
Anyway I’ve tried to give you some cleaningness in the pull request