diff --git a/lime/app/Application.hx b/lime/app/Application.hx index f4f3bef82..0e73fc108 100644 --- a/lime/app/Application.hx +++ b/lime/app/Application.hx @@ -83,8 +83,16 @@ class Application extends Module { private static function __init__ () { var init = ApplicationBackend; - #if (js && html5) - untyped Object.defineProperty (Application.prototype, "window", { get: Application.prototype.get_window }); + #if (js && html5 && es5get) + var p = untyped Application.prototype; + untyped Object.defineProperties (p, { + "frameRate": { get: p.get_frameRate, set: p.set_frameRate }, + "preloader": { get: p.get_preloader }, + "renderer": { get: p.get_renderer }, + "renderers": { get: p.get_renderers }, + "window": { get: p.get_window }, + "windows": { get: p.get_windows } + }); #end } diff --git a/lime/app/Promise.hx b/lime/app/Promise.hx index 6bcc6b376..188fabfc2 100644 --- a/lime/app/Promise.hx +++ b/lime/app/Promise.hx @@ -18,6 +18,19 @@ class Promise { public var isError (get, null):Bool; + #if (js && html5 && es5get) + private static function __init__ () { + + var p = untyped Promise.prototype; + untyped Object.defineProperties (p, { + "isComplete": { get: p.get_isComplete }, + "isError": { get: p.get_isError } + }); + + } + #end + + public function new () { future = new Future (); diff --git a/lime/graphics/Image.hx b/lime/graphics/Image.hx index b60938a26..18c44c626 100644 --- a/lime/graphics/Image.hx +++ b/lime/graphics/Image.hx @@ -110,6 +110,24 @@ class Image { public var y:Float; + #if (js && html5 && es5get) + private static function __init__ () { + + var p = untyped Image.prototype; + untyped Object.defineProperties (p, { + "data": { get: p.get_data, set: p.set_data }, + "format": { get: p.get_format, set: p.set_format }, + "powerOfTwo": { get: p.get_powerOfTwo, set: p.set_powerOfTwo }, + "premultiplied": { get: p.get_premultiplied, set: p.set_premultiplied }, + "rect": { get: p.get_rect }, + "src": { get: p.get_src, set: p.set_src }, + "transparent": { get: p.get_transparent, set: p.set_transparent } + }); + + } + #end + + public function new (buffer:ImageBuffer = null, offsetX:Int = 0, offsetY:Int = 0, width:Int = -1, height:Int = -1, color:Null = null, type:ImageType = null) { this.offsetX = offsetX; diff --git a/lime/graphics/ImageBuffer.hx b/lime/graphics/ImageBuffer.hx index c832c2130..75b9f8801 100644 --- a/lime/graphics/ImageBuffer.hx +++ b/lime/graphics/ImageBuffer.hx @@ -46,6 +46,19 @@ class ImageBuffer { @:noCompletion private var __srcImageData:#if (js && html5) ImageData #else Dynamic #end; + #if (js && html5 && es5get) + private static function __init__ () { + + var p = untyped ImageBuffer.prototype; + untyped Object.defineProperties (p, { + "src": { get: p.get_src, set: p.set_src }, + "stride": { get: p.get_stride } + }); + + } + #end + + public function new (data:UInt8Array = null, width:Int = 0, height:Int = 0, bitsPerPixel:Int = 32, format:PixelFormat = null) { this.data = data; diff --git a/lime/graphics/opengl/GL.hx b/lime/graphics/opengl/GL.hx index 0da2b3c0c..6ece7450a 100644 --- a/lime/graphics/opengl/GL.hx +++ b/lime/graphics/opengl/GL.hx @@ -661,6 +661,18 @@ class GL { private static var __currentProgram:GLProgram; + #if (js && html5 && es5get) + private static function __init__ () { + + untyped Object.defineProperties (GL, { + "type": { get: GL.get_type }, + "version": { get: GL.get_version } + }); + + } + #end + + public static inline function activeTexture (texture:Int):Void { context.activeTexture (texture); diff --git a/lime/media/AudioBuffer.hx b/lime/media/AudioBuffer.hx index 7b5c779bf..ab3a80533 100644 --- a/lime/media/AudioBuffer.hx +++ b/lime/media/AudioBuffer.hx @@ -54,6 +54,18 @@ class AudioBuffer { @:noCompletion private var __srcVorbisFile:#if lime_vorbis VorbisFile #else Dynamic #end; + #if (js && html5 && es5get) + private static function __init__ () { + + var p = untyped AudioBuffer.prototype; + untyped Object.defineProperties (p, { + "src": { get: p.get_src, set: p.set_src } + }); + + } + #end + + public function new () { diff --git a/lime/ui/Window.hx b/lime/ui/Window.hx index a20a708f2..488ae222d 100644 --- a/lime/ui/Window.hx +++ b/lime/ui/Window.hx @@ -83,6 +83,30 @@ class Window { @:noCompletion private var __y:Int; + #if (js && html5 && es5get) + private static function __init__ () { + + var p = untyped Window.prototype; + untyped Object.defineProperties (p, { + "borderless": { get: p.get_borderless, set: p.set_borderless }, + "display": { get: p.get_display }, + "displayMode": { get: p.get_displayMode, set: p.set_displayMode }, + "enableTextEvents": { get: p.get_enableTextEvents, set: p.set_enableTextEvents }, + "fullscreen": { get: p.get_fullscreen, set: p.set_fullscreen }, + "height": { get: p.get_height, set: p.set_height }, + "maximized": { get: p.get_maximized, set: p.set_maximized }, + "resizable": { get: p.get_resizable, set: p.set_resizable }, + "scale": { get: p.get_scale }, + "title": { get: p.get_title, set: p.set_title }, + "width": { get: p.get_width, set: p.set_width }, + "x": { get: p.get_x, set: p.set_y }, + "y": { get: p.get_x, set: p.set_y } + }); + + } + #end + + public function new (config:WindowConfig = null) { this.config = config;