-
-
Notifications
You must be signed in to change notification settings - Fork 812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avm2: Add AIR Screen API #17608
base: master
Are you sure you want to change the base?
avm2: Add AIR Screen API #17608
Conversation
private var _width:int; | ||
private var _height:int; | ||
|
||
[API(661)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this needs a versioning, since the entire Screen class is already versioned
return bounds; | ||
} | ||
|
||
[API(661)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
import flash.geom.Rectangle; | ||
|
||
// [API("733")] Ruffle doesn't support this API Version | ||
[API(661)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this put the versioning in quotes like [API("661")]
for consistency with other versioning metadata?
@@ -211,6 +211,10 @@ impl UiBackend for WebUiBackend { | |||
self.update_mouse_cursor(); | |||
} | |||
|
|||
fn get_screens_sizes(&self) -> Vec<(u32, u32)> { | |||
vec![(self.canvas.width(), self.canvas.height())] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about window.screen.width
/window.screen.height
? https://developer.mozilla.org/en-US/docs/Web/API/Screen/width
@@ -344,6 +348,10 @@ impl UiBackend for NullUiBackend { | |||
Ok(()) | |||
} | |||
|
|||
fn get_screens_sizes(&self) -> Vec<(u32, u32)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn get_screens_sizes(&self) -> Vec<(u32, u32)> { | |
fn get_screen_sizes(&self) -> Vec<(u32, u32)> { |
return screens[0]; | ||
} | ||
|
||
public static native function getScreensInternal():Array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I believe this method shouldn't be public.
- Currently this method is being executed at most once, but the screen configuration may change in time. I'd go with making all methods native and reading always the most recent info (assuming it's what AIR does).
e63bb60
to
b48003a
Compare
No description provided.