Commit Graph

159 Commits

Author SHA1 Message Date
Hajime Hoshi
803e42714e input: Implement wheel event on browsers
Fixes #630
2018-09-30 17:08:18 +09:00
Hajime Hoshi
09c93ac86d ui: Avoid using eval 2018-07-14 23:47:31 +09:00
Hajime Hoshi
e25c237a01 Add IsVsyncEnabled / SetVsyncEnabled
This enables the game to work more efficiently (but consume much
more CPU).

Fixes #405.
2018-07-14 21:43:55 +09:00
Hajime Hoshi
6e51d31524
Use new GopherWasm API (#634)
I plan to merge this right after
https://github.com/gopherjs/gopherwasm/pull/3 is merged.
2018-06-30 00:02:15 +09:00
Hajime Hoshi
f19e349d38 web: Remove IsNodeJS
gjbt now creates a pseudo-Node environment by creating
window.process object, and this conflicted with an assumption that
Ebiten doesn't nothing on Node environment. See
https://github.com/myitcv/gjbt/pull/13 for the detail.

This change allows Ebiten work on pseudo-Node environment. Even
after this change, Ebiten doesn't work on real Node environment
due to lack of DOM.
2018-06-28 00:12:24 +09:00
Hajime Hoshi
a9359e4ef8 Use GopherJS/GopherWasm 2018-06-24 16:10:24 +09:00
Hajime Hoshi
8d644479cc opengl: Initialize consts first to avoid 'Get' calls 2018-06-19 04:02:56 +09:00
Hajime Hoshi
62bd35e412 Avoid 'Get' call if possible
(*js.Value).Get has some overhead especially on Wasm.
2018-06-19 03:43:24 +09:00
Philipp Steinhaus
39b3170185 input: Enable mouse wheel input (#628) 2018-06-18 00:38:30 +09:00
Hajime Hoshi
b87a851c0e ui: New GopherWASM API 2018-06-16 00:26:28 +09:00
Hajime Hoshi
be665a3526 ui: Better way to avoid blocking
Fixes #625
2018-06-09 13:36:35 +09:00
Hajime Hoshi
6e12f287b0 ui: Use goroutine to avoid blocking on GopherJS 2018-06-09 03:05:37 +09:00
Hajime Hoshi
311788dfe2 ui: Remove warnings of deadlock
Now gopherwasm fixed this problem by avoiding js.MakeFunc.

See also: 3fe87b73c0
2018-05-27 04:10:14 +09:00
Hajime Hoshi
8e9c3bd304 ui: Use gopherwasm 2018-05-27 02:35:17 +09:00
Hajime Hoshi
5976e4bbbc audio: More intellegent suspending/resuming (#617)
Before this change, the audio is suspended when the game stops for
1/12[s]. However, as game often stops for more than 1/12[s]
especially on mobiles, this implemntation caused some audio
glitches.

This change fixes this problem by re-implementing suspending/
resumeing audio by detecting the window is active/focused or not.
2018-05-26 23:31:04 +09:00
Hajime Hoshi
c2df8326fc ui: Refactoring: Use IsNodeJS 2018-05-16 22:02:33 +09:00
Hajime Hoshi
d8dba69b47 ui: Add MonitorSize
Fixes #470
2018-05-05 02:42:45 +09:00
Hajime Hoshi
9efccea31c ui: Add SetWindowTitle
Fixes #595
2018-05-02 19:21:17 +09:00
Hajime Hoshi
2d3c6ab5b8 ui: Remove build tag 'gomobilebuild'
Fixes #573
2018-04-07 02:14:54 +09:00
Hajime Hoshi
76cb43a7f8 input: Refactoring: Remove unused arguments 2018-04-03 01:21:52 +09:00
Hajime Hoshi
0f2beab260 ui: Adjust touch positions in ui package (js) 2018-04-03 00:53:09 +09:00
Hajime Hoshi
c540d0fc0d ui: Add AdjustedTouches for consistency 2018-04-02 01:54:44 +09:00
Hajime Hoshi
7d2fd9654a input: Adjust mouse cursor position in ui package 2018-04-01 23:53:26 +09:00
Hajime Hoshi
4de2dc0240 Add input package 2018-04-01 23:20:45 +09:00
Hajime Hoshi
526fbd3619 ui: Implement SetWindowDecorated and IsWindowDecorated
Fixes #430.
2018-03-17 18:30:55 +09:00
Hajime Hoshi
4c1cc9e699 ui: Bug fix: exit update function once when the context is lost (#526) 2018-03-02 01:05:54 +09:00
Hajime Hoshi
a644e92298 restorable: Better calculation to clear restorable.Image 2018-02-24 21:16:30 +09:00
Hajime Hoshi
d4b8b99784 ui: Bug fix: return is needed for Edge case
Fixes #507
2018-02-21 21:53:49 +09:00
Hajime Hoshi
8b2ed6cddd ui: Update GraphicsContext every frame (#490) 2018-02-02 02:08:03 +09:00
Hajime Hoshi
38c72faf95 ui: Deprecate SetCursorVisibility and add SetCursorVisible (#407) 2018-01-09 02:01:33 +09:00
Hajime Hoshi
0a911b28b2 ui: Remove unneeded variable deviceScale 2018-01-07 14:51:25 +09:00
Hajime Hoshi
34d2e9a3fb ui: Remove unused function 2018-01-07 05:25:29 +09:00
Hajime Hoshi
c82809867d Add internal/devicescale 2018-01-03 05:22:56 +09:00
Hajime Hoshi
cea9bd5a19 input: Bug fix: runeBuffer should be reset on each frame 2017-11-10 01:21:15 +09:00
Hajime Hoshi
4b83a060fe ui: Add more keys not for charCode 2017-11-10 00:46:37 +09:00
Hajime Hoshi
fb8bef99c3 ui: Bug fix: key event on Edge browser 2017-11-10 00:39:46 +09:00
Hajime Hoshi
37ca48dc38 ui: Rename functions from Safari to Edge 2017-11-10 00:35:46 +09:00
Hajime Hoshi
0c0cd7e9d6 ui: Bug fix: call preventDefault for arrow keys
Fixes #450
2017-11-10 00:32:47 +09:00
Hajime Hoshi
835d199f02 ui: Rename SetIcon to SetWindowIcon (#386) 2017-09-23 17:40:09 +09:00
Hajime Hoshi
dacda0d176 ui: Add SetIcon (#386) 2017-09-23 04:28:57 +09:00
Hajime Hoshi
0dcba7844b ui: Bug fix: SetScreenSize didn't work on browsers
This fixes #427
2017-09-07 11:58:04 +09:00
Hajime Hoshi
99d170b454 ui: Remove isSafari that is not used anywhere 2017-08-27 02:14:23 +09:00
Jake
0d703ca3d4 InputChars (#403)
This implements #400
2017-08-15 04:11:51 +09:00
Hajime Hoshi
b186bc1e94 ui: Add IsCursorVisible (#377) 2017-08-12 15:45:16 +09:00
Hajime Hoshi
f0d47312c4 ui: Add IsRunnableInBackground / SetRunnableInBackground (#272) 2017-08-03 03:21:51 +09:00
Hajime Hoshi
5ae03494f2 ui: Resize canvas size when the window is resized (#387) 2017-07-22 02:04:15 +09:00
Hajime Hoshi
63e3bc73d6 ui: Implement fullscreen for browsers (#387) 2017-07-22 01:52:08 +09:00
Hajime Hoshi
e582a661c9 ui: Bug fix: Should add <meta> to <head> instead of <body> 2017-07-02 04:18:43 +09:00
Hajime Hoshi
d6466fdcaf ui: Bug fix: initial scale must be 1 for proper scaling 2017-07-02 04:08:25 +09:00
Hajime Hoshi
ba204c6d3b ui: Adjust cursor positoin on fullscreen mode (#374) 2017-07-01 04:27:38 +09:00