Hajime Hoshi
7d56e4335e
ui: Add RunGame, WindowSize and SetWindowSize
...
This change introduces the new APIs RunGame, WindowSize and
SetWindowSize. These new APIs hides the notion of 'scale', and is
more flexible with the outside size change. This means that we can
introduce a resizable window.
This change also adds -legacy flag to examples/windowsize. If the
flag is off, the new APIs are used.
This change deprecates these functions since the notion of 'scale'
is deprecated:
* ScreenScale
* ScreenSizeInFullscreen
* SetScreenScale
* SetScreenSize
Fixes #943 , #571
Updates #320
2019-12-22 03:35:31 +09:00
Hajime Hoshi
aad5db8939
examples/windowsize: Change the delta of moving the window
2019-12-21 17:08:04 +09:00
Hajime Hoshi
bda11b0e17
driver: Add UI.SetWindowSize and UIContext.Layout
...
This is a preparation to introduce RunGame function.
Updates # 943 (Fix this line before committing)
2019-12-15 02:29:43 +09:00
Hajime Hoshi
0ec447e0d0
ui: Add SetScreenTransparent / IsScreenTransparent
...
Fixes #1001
2019-12-01 03:31:32 +09:00
Hajime Hoshi
d78b4d7ffd
examples/windowsize: Add messages about moving the window
2019-11-30 23:59:45 +09:00
Hajime Hoshi
9b2f864fc8
ui: Add SetWindowPosition(x, y int)
...
Fixes #936
2019-11-30 23:22:39 +09:00
Hajime Hoshi
c021d6be6a
ui: Add WindowPosition()
...
Fixes #936
2019-11-30 22:37:56 +09:00
Hajime Hoshi
e0d780b029
uidriver/glfw: Enable to call SetWindowDecorated after Run
...
Fixes #556
2019-11-26 11:46:18 +09:00
Hajime Hoshi
32c04767da
examples/audio: Switchable to MP3 from Ogg
2019-10-30 00:33:29 +09:00
Hajime Hoshi
49a5a2bf4e
uidriver/js: Bug fix: Needed to initialize pseudoScale with the given scale
...
Updates #960 , #973
2019-10-27 17:16:49 +09:00
Hajime Hoshi
b8da9cf041
examples/moire: Bug fix: Crash on browsers
...
Fixes #973
2019-10-27 17:00:14 +09:00
Hajime Hoshi
f34e94ff2c
examples/squiral: Fix title
2019-10-22 23:18:16 +09:00
Hajime Hoshi
00ae15082d
examples/flappy: Change the spelling: Gameover -> Game over
2019-10-18 02:15:37 +09:00
Hajime Hoshi
87bc2e6f02
examples/sprites: Accept touches
2019-10-18 01:56:54 +09:00
Hajime Hoshi
75721e6fc1
ui: Auto scaling on browsers
...
This change forces Ebiten apps on browsers 'fullscreen' mode.
After this change, 'scale' value is no longer used on browsers.
Note that this breaks backward compatibility, but as long as the
game works in an iframe, this should not be problematic.
Fixes #960
2019-10-15 00:02:02 +09:00
Hajime Hoshi
726de29f36
examples/windowsize: Remove Q key to terminate
...
Not having a way to terminate the app is more portable. Browsers
and mobiles don't have the notion of 'termination'.
2019-10-14 23:49:42 +09:00
Hajime Hoshi
c30918261b
gofmt -s -w
2019-10-12 01:09:42 +09:00
David Linus Briemann
9082edf03f
Add new example: squirals ( #952 )
2019-10-09 00:54:23 +09:00
Hajime Hoshi
5b22a1218e
examples: Fix warnings in the examples
...
Updates #889
2019-10-07 03:05:26 +09:00
Hajime Hoshi
fcca95dfa8
examples/set: Add FPS to see the performance
2019-10-04 01:51:26 +09:00
Hajime Hoshi
83b2d4b112
input: driver.Key now distinguishes left/right modifier keys
...
This is a preparation for event package, that will have key enum.
Updates #926
2019-09-01 23:49:00 +09:00
Hajime Hoshi
d25d184ed7
graphics: Bug fix: wrong for loops in TestImageMipmap*
2019-07-30 19:19:30 +09:00
Hajime Hoshi
80ae508d29
examples/contextlost: Bug fix: Add 'js' build tag
...
Importing 'syscall/js' requires 'js' environment.
2019-05-01 17:55:12 +09:00
Hajime Hoshi
10fb5e33be
Replace GopherWasm with syscall/js
...
Fixes #857
2019-05-01 17:28:00 +09:00
Hajime Hoshi
020cba22c5
vector: Implement miter limit
...
Fixes #843
2019-04-20 23:08:20 +09:00
Hajime Hoshi
5487dd9ea8
examples/vector: Add rotating points and lines by them
2019-04-14 23:15:03 +09:00
Hajime Hoshi
edbb5b4e0d
vector: Better line joints
...
Bug: #842
2019-04-14 15:48:20 +09:00
Hajime Hoshi
6bd9ef6abd
vector: Bug fix: wrong color value
2019-04-14 02:11:25 +09:00
Hajime Hoshi
8d912a402f
examples/vector: Render more texts
2019-04-14 01:58:20 +09:00
Hajime Hoshi
d7bd89d32b
Add vector package (Work in progress)
2019-04-14 00:37:38 +09:00
Hajime Hoshi
f56c3bd096
ui: Unexport SetWindowResizable ( #320 )
2019-02-25 02:19:47 +09:00
Hajime Hoshi
fc43868f21
examples/sprites: Rotate sprites
2019-02-24 02:09:38 +09:00
Hajime Hoshi
f7e7598567
examples/particles: Reduce emittion
2019-02-24 01:26:07 +09:00
Hajime Hoshi
0a35efbba9
Add examples/particles
...
Fixes #826
2019-02-24 01:20:06 +09:00
Hajime Hoshi
6906ea1c4f
examples/raycasting: Refactoring
2019-02-19 00:03:35 +09:00
Hajime Hoshi
b7c1d8db3c
examples/doomfile: Skip renderFire when possible
2019-02-15 00:54:11 +09:00
Hajime Hoshi
17daf99c3c
examples/airship: Show FPS
2019-02-12 13:03:32 +09:00
Cesar Gimenes
f361bb05dd
examples: Add doom fire algorithm example ( #808 )
2019-02-09 14:39:11 -10:00
Hajime Hoshi
5be567d58f
ui: Implement restoring context lost on browsers correctly
...
Fixes #734
2019-02-01 01:20:40 +09:00
Hajime Hoshi
7dafbb2e4e
examples/sinewave: Bug fix: Sinewave volume was too small
2019-01-20 02:17:10 +09:00
Hajime Hoshi
79b5712410
examples/sinewave: Refactoring (return the copied bytes)
2019-01-19 18:42:39 +09:00
Hajime Hoshi
808f512a7d
examples/sinewave: Refactoring
2019-01-19 18:36:03 +09:00
Hajime Hoshi
5cd66b6d6b
examples/audio: Remove unused functions
2019-01-15 02:13:18 +09:00
Hajime Hoshi
5a612f60b6
examples/audio: Bug fix: Do not close after Run
...
Now Run can return immediately on GopherJS.
In general, graceful shutdown should not be expected since there
is no 'end' phase on some environments.
Fixes #784
2019-01-15 02:11:23 +09:00
Hajime Hoshi
ea29637fda
examples/set: Use color.RGBA
2019-01-14 20:04:58 +09:00
Hajime Hoshi
67ce6c57c4
Add examples/set
2019-01-14 19:31:07 +09:00
Hajime Hoshi
1f277f7a2c
example/raycasting: Refactoring
2019-01-12 23:54:15 +09:00
Magnus
4a4f45ffd7
example/shadow-raycasting ( #780 )
2019-01-12 23:46:03 +09:00
Hajime Hoshi
ae84e79d16
ui: Add IsWindowResizable and SetWindowResizable (again)
...
Fixes #320
2019-01-09 00:24:16 +09:00
Hajime Hoshi
0d4e903b7a
Revert "ui: Add IsWindowResizable and SetWindowResizable"
...
This reverts commit f403e0716f
.
Reason: Compilation error on browsers
2019-01-09 00:12:57 +09:00
Hajime Hoshi
f403e0716f
ui: Add IsWindowResizable and SetWindowResizable
...
Fixes #320
2019-01-08 23:52:53 +09:00
Hajime Hoshi
aadfbc3e70
examples/blur: Fix comments about #694
2019-01-06 19:22:27 +09:00
Hajime Hoshi
348e50c5e7
examples/audio: Show the current volume ( #730 )
2019-01-05 01:43:22 +09:00
Hajime Hoshi
f1582c2d73
graphics: Add Address representing a sampler address mode
...
Fixes #761
2018-12-24 17:29:31 +09:00
Hajime Hoshi
e4d976e964
examples/sprites: Add FPS
2018-12-23 01:23:38 +09:00
Hajime Hoshi
9142a077cf
examples/pcm: Add intervals between notes
2018-12-17 23:25:52 +09:00
Hajime Hoshi
732b036343
Revert "examples/pcm: Bug fix: audio.Player refs should be held not to be GCed"
...
This reverts commit 52f0bd7e21
.
2018-12-17 02:34:10 +09:00
Hajime Hoshi
52f0bd7e21
examples/pcm: Bug fix: audio.Player refs should be held not to be GCed
...
Now audio.Player can be GCed after #746 was fixed.
2018-12-17 02:06:55 +09:00
Hajime Hoshi
a88deb03b5
Fix misspelling (again)
2018-12-03 18:25:44 +01:00
Hajime Hoshi
155ee828b8
Fix misspelling
2018-12-03 18:23:25 +01:00
Hajime Hoshi
ebffaeba3d
examples/minify: Better clipping
2018-11-09 01:08:32 +09:00
Hajime Hoshi
710f56531f
graphics: Experimental: (*image.Image).SubImage
...
Fixes #722
2018-10-28 02:19:14 +09:00
Hajime Hoshi
8b82667df1
graphics: Bug fix: Violating edge pixels with linear filter
...
Fixes #724
2018-10-26 00:48:51 +09:00
Hajime Hoshi
d14202ef7b
audio: Add Context.IsReady
...
Fixes #717
2018-10-16 00:02:19 +09:00
Hajime Hoshi
b6f7a0043c
examples/windowsize: Show DeviceScaleFactor
2018-10-14 19:15:26 +09:00
Hajime Hoshi
443e3ae3a4
examples/windowsize: Bug fix: Strange delta of window size
2018-10-14 17:34:02 +09:00
Hajime Hoshi
13174cdb22
examples/flappy: Should use fullscreen on Wasm
2018-10-14 01:21:13 +09:00
Hajime Hoshi
56541a8c0a
examples/blocks: Fix message
2018-10-14 00:55:27 +09:00
Hajime Hoshi
d6e109555d
examples/blocks: Bug fix: multiple gamepad detection
2018-10-13 16:59:52 +09:00
Hajime Hoshi
8ed02efd28
examples/blocks: Improve gameover message
2018-10-13 16:59:52 +09:00
Hajime Hoshi
244e078810
examples/audioinfiniteloop: Fix message
2018-10-13 14:46:13 +09:00
Hajime Hoshi
0fb33e7c36
examples/highdpi: Bug fix: doesn't work well on multiple monitors
2018-10-13 03:59:31 +09:00
Hajime Hoshi
659f3ad8a0
examples/fullscreen: Fix offset
2018-10-12 01:11:14 +09:00
Hajime Hoshi
0509abfab6
examples: Use FilterDefault at NewImage
2018-10-12 00:40:48 +09:00
Hajime Hoshi
c758a1f8c6
ui: Rename MonitorSize -> ScreenSizeInFullscreen ( #708 )
2018-10-09 23:42:03 +09:00
Hajime Hoshi
8ac50a47f9
examples/blur: Fix comments
2018-10-01 02:37:53 +09:00
Hajime Hoshi
502919dea0
examples/blur: Add comments
2018-09-30 23:17:17 +09:00
Hajime Hoshi
66ca53529b
examples: Add blur example
2018-09-30 23:07:33 +09:00
Hajime Hoshi
0224858b7b
examples/wheel: Improve message
2018-09-30 17:13:22 +09:00
Hajime Hoshi
ecef9cab0f
examples: Add wheel example
2018-09-30 17:03:40 +09:00
Hajime Hoshi
2923bec0dc
examples: Use TPS instead of FPS to indicate how fast the app works
2018-09-30 02:27:33 +09:00
Hajime Hoshi
eb0f0e6ced
examples: Adjust samplerate not to cause resampling
...
Fixes #687
2018-09-28 03:55:28 +09:00
Hajime Hoshi
d243957ab1
examples/audioinfiniteloop: Refactoring: Remove magic numbers
2018-09-28 01:52:30 +09:00
Hajime Hoshi
56d8ce9935
examples/audioinfiniteloop: Use NewInfiniteLoopWithIntro
...
Fixes #656
2018-09-28 01:45:40 +09:00
Hajime Hoshi
e1347c58ca
examples/shapes: Use DrawTriangles for rectangles ( #680 )
2018-09-15 19:00:57 +09:00
Hajime Hoshi
76ca296cdd
examples/shapes: Bug fix: correct calculation
2018-09-15 18:15:16 +09:00
Hajime Hoshi
5587af9d7e
examples/shapes: Use DrawTriangles ( #680 )
2018-09-15 17:20:35 +09:00
Hajime Hoshi
3d1d5d4355
examples/audio: Use Ogg again
2018-09-03 00:49:06 +09:00
Hajime Hoshi
864eebbcd9
examples/resources: Add Ragtime_ogg
2018-09-02 23:08:02 +09:00
Hajime Hoshi
f2b4dfd061
examples/polygon: Better coloring
2018-08-14 02:14:19 +09:00
Hajime Hoshi
340a4b4dfa
examples: Rename triangles -> polygons
2018-08-14 01:56:08 +09:00
Hajime Hoshi
7807488cc7
examples/triangles: Fix terms
2018-08-14 01:55:22 +09:00
Hajime Hoshi
1b8cad4e1d
examples/triangles: Draw polygons
2018-08-14 01:49:45 +09:00
Hajime Hoshi
5032546238
examples: Rename triangle -> triangles
2018-08-14 01:30:42 +09:00
Hajime Hoshi
2360b2930f
graphics: Add DrawTriangles
...
Fixes #624
2018-08-14 01:23:14 +09:00
Hajime Hoshi
b02b2de626
examples/minify: Add rotation
2018-07-29 23:24:18 +09:00
Hajime Hoshi
a321155ab5
examples/minify: Improve minifying demonstration
2018-07-29 22:19:22 +09:00
Hajime Hoshi
c39c211d1f
Add examples/minify
2018-07-29 18:58:30 +09:00
Hajime Hoshi
b9265d5120
Enable to go-generate under non-GOPATH directories
2018-07-28 19:21:19 +09:00
Hajime Hoshi
0593b77eb8
ui: Implement CurrentTPS
2018-07-18 02:11:00 +09:00
Hajime Hoshi
e99f2f9f69
ui: Rename TPS -> MaxTPS
2018-07-17 22:41:27 +09:00
Hajime Hoshi
eadbabffd9
examples/windowsize: Use more consts
2018-07-17 22:36:55 +09:00
Hajime Hoshi
a7a1f6b4c6
ui: Rename SetTPS -> SetMaxTPS, Introduce UncappedTPS
2018-07-17 22:33:53 +09:00
Hajime Hoshi
328c5ff7e1
examples/windowsize: Fix message
2018-07-17 21:58:58 +09:00
Hajime Hoshi
16c6ab4d07
ui: Introduce DefaultTPS and deprecate FPS
2018-07-17 02:07:03 +09:00
Hajime Hoshi
3a8ca5ad73
ui: Implement TPS/SetTPS
...
Fixes #605
Fixes #321
2018-07-17 01:58:00 +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
3cd9dfd800
Rename IsRunningSlowly to IsDrawingSkipped
...
Fixes #643
2018-07-10 22:31:26 +09:00
Hajime Hoshi
4a6faf5505
Add examples/animation
...
Fixes #640
2018-07-09 22:50:34 +09:00
Hajime Hoshi
21fd6a2edc
examples/flappy: Remove println
2018-07-04 00:23:34 +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
a9359e4ef8
Use GopherJS/GopherWasm
2018-06-24 16:10:24 +09:00
Hajime Hoshi
5680ce7f46
examples/sprites: Update only shown sprites
2018-06-17 22:05:34 +09:00
Hajime Hoshi
9f34b79297
examples/sprite: Refactoring
2018-06-17 18:44:32 +09:00
Hajime Hoshi
a54b6060bd
examples/windowsize: Add 0.75 scale
2018-06-03 02:32:42 +09:00
Hajime Hoshi
5f3a42aab9
examples/flappy: Add license comment
2018-05-28 02:38:55 +09:00
Hajime Hoshi
cc748f15e4
examples/contextlost: Use gopherwasm
2018-05-25 02:08:32 +09:00
Hajime Hoshi
569639d485
examples/contextlost: Bug fix: don't crash on Edge
...
Fixes #613
2018-05-14 00:35:40 +09:00
Hajime Hoshi
a92cc0f4b3
examples/drag: Bug fix: nil error
...
Fixes #612
2018-05-14 00:06:03 +09:00
Hajime Hoshi
b69d564d89
examples/life: Refactoring
2018-05-13 00:38:33 +09:00
Hajime Hoshi
f7c19ef517
examples/drag: Put the moving sprites frontend
2018-05-12 23:22:50 +09:00
Hajime Hoshi
07009501f9
examples: Move resource files
2018-05-12 17:09:42 +09:00
Hajime Hoshi
252f4430d8
examples/drag: Add touches ( #506 )
2018-05-11 02:02:33 +09:00
Hajime Hoshi
fbeed96bb5
input: Add TouchIDs and TouchPosition ( #497 )
...
This change deprecates Touch interface and Touches function.
2018-05-07 00:31:46 +09:00
Hajime Hoshi
d8dba69b47
ui: Add MonitorSize
...
Fixes #470
2018-05-05 02:42:45 +09:00
Hajime Hoshi
4d3d407205
graphics: Add comments to At
2018-05-01 18:07:52 +09:00
Hajime Hoshi
b60d549924
Add examples/drag ( #506 )
2018-05-01 01:12:40 +09:00
Hajime Hoshi
db3effe65a
inpututil: Rename JustPressedTouches -> JustPressedTouchIDs
2018-04-30 20:07:27 +09:00
Hajime Hoshi
342551da8d
examples: Add iOS explanation
2018-04-30 19:49:02 +09:00
Hajime Hoshi
1d70ee7988
examples: gomobilebuild build tag is no longer needed
2018-04-30 19:43:29 +09:00
Hajime Hoshi
a355d701ad
inpututil: Replace JustDisconnectedGamepadIDs with IsGamepadJustDisconnected ( #505 )
2018-04-30 04:35:10 +09:00
Hajime Hoshi
52dea245dc
examples/blocks: Use IsGamepadButtonJustPressed
2018-04-30 03:43:50 +09:00
Hajime Hoshi
b1c55f395f
examples/gamepad: Refactoring
2018-04-30 03:07:02 +09:00
Hajime Hoshi
9d57350a42
inpututil: Add JustConnectedGamepadIDs / JustDisconnectedGamepadIDs
...
Fixes #505
2018-04-30 02:51:38 +09:00
Hajime Hoshi
b22cc9d4be
Add periods after 'DO NOT EDIT'
2018-04-28 03:37:19 +09:00
Hajime Hoshi
3fa2beb502
Fix the do-not-edit comment https://golang.org/s/generatedcode
2018-04-20 00:54:33 -07:00
Hajime Hoshi
07545c3706
examples/typewriter: consider repeating state
2018-04-14 05:39:42 +09:00
Hajime Hoshi
54bec7a3eb
examples/typewriter: Refactoring: Use inpututil
2018-04-14 05:32:41 +09:00
Hajime Hoshi
fac7651152
examples/keyboard: Show other keys than 'keyboard' keys
2018-04-14 04:59:06 +09:00
Hajime Hoshi
bf304e6ac8
examples/keyboard: Refactoring: Use ebiten.Key to get the rect
2018-04-14 04:48:07 +09:00
Hajime Hoshi
9fb25693a3
examples/keyboard: Remove the last period from do-not-edit comment
2018-04-14 04:23:34 +09:00
Hajime Hoshi
dbe990a060
Use the latest file2byteslice
2018-04-14 04:19:11 +09:00
Hajime Hoshi
f1fa8804d3
inpututil: Add JustPressedTouches and remove IsJustTouched
...
Fixes #576
2018-04-08 04:59:13 +09:00
Hajime Hoshi
ce2168c0d6
examples/flappy: Bug fix: wrong calculation of rotating
2018-04-08 00:38:52 +09:00
Hajime Hoshi
f2e2f602c5
examples/flappy: Bug fix: first touch ID might not be 0 on iPhone Safari ( #576 )
2018-04-07 23:36:38 +09:00
Hajime Hoshi
35557e845d
examples/flappy: Improve message
2018-04-07 23:26:28 +09:00
Hajime Hoshi
b952cb724f
examples/flappy: Fullscreen on browsers
2018-04-07 22:23:50 +09:00
Hajime Hoshi
2a6672cc8b
examples: Add examples/flappy
2018-04-07 22:15:45 +09:00
Hajime Hoshi
948c1e13fb
examples/chipmunk: Fix styles
2018-04-03 21:47:46 +09:00
Hajime Hoshi
da66866b3a
examples/chipmunk: Fix styles: Create 'dot' image only once
2018-04-03 21:45:27 +09:00