A simple example is instantiating when accessing the object:
public function myObject():Object
{
if ( this.myObject == null ) this.myObject= new Object();
return this.myObject;
}
Haxe, NME, ...
public function myObject():Object
{
if ( this.myObject == null ) this.myObject= new Object();
return this.myObject;
}
![]() |
| result, heuristic and source |
![]() |
| voxel and normalmapping rendering results with different lightning and maps |
<window width="600" height="480" if="flash" /> <window width="???" height="???" if="html5" /> <!-- how 100%? only INT allowed ... -->But using the % character causes errors when compiling for HTML. Another way would be to simply change the generated index.html but although the index might not need to be generated, it will be every time you compile and replaces any change you might have made. Not so cool :|
<div id="haxe:jeash"
style="background-color: #FFFFFF; width: 100%; height: 100%"
data-framerate="60">
</div>
Maybe there is a way to prevent the compiler from replacing your
index.html but ideally I would be able to change the dimesion at runtime
anyway.