Commit Graph

968 Commits

Author SHA1 Message Date
Ketchetwahmeegwun T. Southall
60b7de6a3c
ebiten: add APIs to treat monitors (#2597)
This change adds these APIs:

* `type MonitorType`
* `func (*MonitorType) Bounds() image.Rectangle`
* `func (*MonitorType) Name() string`
* `func Monitor() *MonitorType`
* `func SetMonitor(*MonitorType)`
* `func AppendMonitors([]*MonitorType) []*MonitorType`

Closes #1835
2023-08-30 21:02:04 +09:00
Hajime Hoshi
db34930ae8 internal/graphics: add built-in Kage functions
This change adds these Kage functions:

* imageDstOrigin
* imageDstSrc
* imageSrcNOrigin
* imageSrcNSrc

and deprecates these functions:

* imageDstRegionOnTexture
* imageSrcRegionOnTexture

Closes #1870
2023-08-28 15:06:45 +09:00
Hajime Hoshi
101c9cbf5c examples/flappy: use the pixels mode 2023-08-28 03:52:52 +09:00
David Poirier
7fe89b173b
examples/gamepad: bug fix: correct iteration start button in gamepad example (#2730)
Start iterating at zero instead of gamepad id (which is usually 0).
2023-08-24 16:27:35 +09:00
Hajime Hoshi
2b03637b52 examples/textinput: bug fix: reset the state after committing 2023-08-02 18:09:55 +09:00
Hajime Hoshi
af5edf136d examples/textinput: add a comment 2023-08-02 18:02:42 +09:00
Hajime Hoshi
fbea792fe4 audio: rename Seek -> SetPosition and Current -> Position
Seek and Current are not removed but marked as deprecated.

Closes #2698
2023-08-02 01:24:52 +09:00
Hajime Hoshi
b3851839f9 examples/life: change the license to Apache License 2.0
Updates #2695
2023-08-01 23:36:02 +09:00
Hajime Hoshi
63df6168d9 internal/shader: use plural forms for Kage compiler directives
This change renames

```
//kage:unit texel
//kage:unit pixel
```

to

```
//kage:unit texels
//kage:unit pixels
```

.

Closes #2717
2023-08-01 11:41:38 +09:00
Mathieu Champlon
f3023ae88e
examples/lines: remove duplicated code (#2713) 2023-07-29 13:29:19 +09:00
Hajime Hoshi
91e1c0ea29 ebiten: add more cursor shapes
This change adds these new cursor shapes:

* CursorShapeNESWResize
* CursorShapeNWSEResize
* CursorShapeMove
* CursorShapeNotAllowed

Closes #2476
2023-07-23 00:49:45 +09:00
Hajime Hoshi
58f1415cac examples/texti18n: use Jpan as a Japanese script 2023-07-09 15:17:25 +09:00
Hajime Hoshi
f8d8d7a231 examples/life, internal/graphicsdriver/opengl/gl: format copyright texts 2023-07-08 02:50:54 +09:00
Hajime Hoshi
929539b66e add exp/textinput package
This works only for macOS and browsers so far.

Updates #1029
2023-07-05 02:09:04 +09:00
Hajime Hoshi
1d143ffccb examples/texti18n: add comments
Updates #2454
2023-07-01 19:57:45 +09:00
Hajime Hoshi
198bd4788e examples/texti18n: bug fix: space characters were ignored 2023-07-01 18:17:01 +09:00
Hajime Hoshi
3ab50c91df examples: add examples/texti18n
This example shows how to render complex glyphs like Thai and Arabic.

Updates #675
2023-07-01 18:04:05 +09:00
Hajime Hoshi
1514749041 examples/text: remove a dependency on math/rand 2023-06-25 01:33:25 +09:00
Hajime Hoshi
569f472475 examples: replace BoundString with MeasureString and Metrics 2023-06-11 04:26:16 +09:00
Hajime Hoshi
7791ae3029 examples/text: bug fix: go-vet error 2023-06-10 19:29:14 +09:00
Hajime Hoshi
911cf0c48c text: deprecate BoundString
After we found a correct definition of the term 'dot', BoundString seems
less useful than expected. In order to adjust the position of a text, we
should use a face's Metrics and a string's advance (font.MeasureString).
2023-06-10 19:21:04 +09:00
Hajime Hoshi
41906115f4 examples/blend: use the face's metrics to calculate the position
For centering, using bounds is slightly inaccurate as the bounds
don't consider left/right-side bearings. Also, using bounds for
heights is slightly inaccurate as baselines for texts on the same
line would not be the same.

Updates #2143
2023-06-02 01:58:21 +09:00
Hajime Hoshi
f446288e0c update bitmapfont to v3 2023-05-30 11:17:36 +09:00
Hajime Hoshi
49582519c1 all: add a compiler directive kage:unit
This change adds a new compiler directive 'kage:unit' to Kage. This
takes one of these two values: 'pixel' and 'texel'. The default value
is 'texel'.

With the pixel-unit mode, all the built-in functions treats pixels
instead of texels, and the texCoord argument of Fragment is in pixels.
This simplifies shader programs as programs no longer have the notion
of texels.

With the texel-unit mode, the behavior is the same as the current
behavior.

Closes #1431
2023-04-23 22:11:57 +09:00
Hajime Hoshi
01bb42526a examples/shader: refactoring 2023-04-23 16:29:23 +09:00
Eric H
1fdc45e652
example: add a mouse capture example (#2642)
Closes #2641
2023-04-19 13:02:02 +09:00
Hajime Hoshi
bf18a5e998 examples/shader: bug fix: normalize pos correctly 2023-04-17 22:36:31 +09:00
Hajime Hoshi
820548ed68 example/shader: make default.go more deterministic 2023-04-17 22:27:27 +09:00
Hajime Hoshi
1c14ba8eeb examples/shader: add comments
Updates #1431
2023-04-13 14:16:55 +09:00
Hajime Hoshi
0776a54712 examples/shader: remove comments 2023-04-13 14:10:34 +09:00
Hajime Hoshi
2d6e13cda4 examples/shader: bug fix: wrong usages of position
Closes #2638
Updates #1431
2023-04-13 02:02:15 +09:00
Hajime Hoshi
3564a44638 examples/windowsize: add a new flag -runnableonunfocused 2023-04-01 03:13:47 +09:00
Hajime Hoshi
cbff3555db internal/graphicsdriver/opengl: drop WebGL 1 support
Closes #2191
2023-03-18 22:50:09 +09:00
Hajime Hoshi
8bd7ce5c20 vector: add anti-alias options to the utility functions
Closes #2606
2023-03-18 11:01:48 +09:00
Hajime Hoshi
e4aace6c40 examples/blend: shrink the window for small displays 2023-03-14 22:21:35 +09:00
Hajime Hoshi
3951df05c8 examples/audiopanning: fix the initial panning 2023-03-14 21:30:55 +09:00
Hajime Hoshi
84a86c86e4 examples/blend: disable resizing the window 2023-03-14 21:22:27 +09:00
Hajime Hoshi
903b5ab046 examples/blend: clean up 2023-03-13 02:11:05 +09:00
Hajime Hoshi
80cbf7cbae examples: bug fix: wrong sample rate 2023-03-13 00:23:57 +09:00
Hajime Hoshi
597fe171a4 examples/additive: remove examples/additive
This is duplicated with examples/blend.
2023-03-12 23:44:53 +09:00
Hajime Hoshi
c568668149 examples/subimage: add a comment
Updates #2471
2023-02-17 02:06:40 +09:00
Hajime Hoshi
68775cf065 examples/vector: specify alpha values explicitly 2023-02-14 19:26:14 +09:00
Hajime Hoshi
cb61633b70 examples/lines: specify color values explicitly 2023-02-14 19:14:38 +09:00
Hajime Hoshi
10f022e129 examples/lines: specify alpha values explicitly 2023-02-14 19:12:26 +09:00
Artem Sedykh
da54f19df5
add blend modes example (#2563) 2023-02-07 11:59:49 +09:00
quasilyte
ce36527d16
examples/camera: fix window title (#2564) 2023-02-06 17:31:23 +09:00
Hajime Hoshi
38a6583438 examples/audio: change the sample rate from 32000 -> 48000 2023-01-27 14:58:17 +09:00
Hajime Hoshi
0c76a0cbd7 examples/dropfile: bug fix: handle errors correctly 2023-01-25 15:25:06 +09:00
Hajime Hoshi
f009dd8dd2 ebiten: implement DroppedFiles to replace AppendDroppedFiles
Closes #2552
2023-01-25 14:27:11 +09:00
Hajime Hoshi
e03cb0d4df examples/dropfile: bug fix: go vet failed 2023-01-22 17:31:24 +09:00