Closed aW4KeNiNG closed 6 years ago
I would like to keep Heaps x/y inlined, I'm not sure if I have a good solution for you, do you have any suggestion?
I'm not sure for a good solution. I don't know if it is possible with a macro (that already exists in haxe or a new macro implemented in HaxeUI) to avoid that behaviour and skip the error. Do you see it possible with that?
Another possible (poor) solution is a conditional compilation, like:
#if !no_inline_flag inline #end function set_x(v) { ... }
I don't pretend to remove the inline word. I understand it could be critical in the performance. Just I want to check some kind of valid solution in this case, if it is possible, ofc.
There might be some solution involving macros.
You first need to inject @:build metadata to h2d.Sprite class using --macro patchTypes("patch.txt")
The content of the patch.txt
would look like:
@:build(MyMacro.build()) h2d.Sprite
Then in that build macro you can remove the inline
for the fields you need.
This is awesome!!
It is working :) . Thanks @ncannasse !!!
Hi!
I'm writing the haxeui-heaps backend.
Currently I have a problem when I try to override the
x
andy
fields, because they are inline functions. Maybe it needs to be inlined for performance reasons. So I need to check with you some kind of solution for the problem.The
Component
class in HaxeUI hasx
andy
fields (and that class extendsComponentBase
, implemented for each backend). In the haxeui-heaps backend,ComponentBase
extendsSprite
class in Heaps.Sprite
hasx
andy
fields as (default, set), but the setter method is inlined. I don't know if it is possible to fix that with a macro.I want to avoid the inclusion of a
var sprite:Sprite
inside ofComponentBase
.Anyway, here some screenshots with the progress in the implementation (almost finished).