You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Animation.md
+2-8
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ You can learn more about Heaps resource management and using [`hxd.Res`](https:/
30
30
31
31
## Properties and methods
32
32
33
-
The following properties and methods can be accessed on [h2d.Anim](https://github.com/ncannasse/heaps/blob/master/h2d/Anim.hx):
33
+
The following properties and methods can be accessed on [h2d.Anim](https://heaps.io/api/h2d/Anim.html):
34
34
35
35
*`speed` : changes the playback speed of the animation, in frames per seconds.
36
36
*`loop` : tells if the animation will loop after it reaches the last frame.
@@ -42,10 +42,4 @@ anim.onAnimEnd = function() {
42
42
}
43
43
```
44
44
45
-
`Anim` instances have other properties which can be discovered by reviewing the [`h2d.Anim`](https://github.com/ncannasse/heaps/blob/master/h2d/Anim.hx) class.
46
-
47
-
## Using image resources
48
-
49
-
What you'll probably need for your game is actually using your image resources and sprites.
50
-
- This is a small external github sample: https://github.com/Beeblerox/Simplest-Heaps-Examples/tree/master/04_heaps_anim
51
-
It uses an image to create a sprite strip/sheet from it.
45
+
`Anim` instances have other properties which can be discovered by reviewing the [`h2d.Anim`](https://heaps.io/api/h2d/Anim.html) class.
Copy file name to clipboardExpand all lines: Drawable.md
+8-5
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Drawable
2
2
3
-
H2D classes that can display something on screen usually extend the [`h2d.Drawable`](https://github.com/ncannasse/heaps/blob/master/h2d/Drawable.hx) class.
3
+
H2D classes that can display something on screen usually extend the [`h2d.Drawable`](https://heaps.io/api/h2d/Drawable.html) class.
4
4
5
-
Each Drawable (including [`h2d.Bitmap`](https://github.com/ncannasse/heaps/blob/master/h2d/Bitmap.hx)) has several properties that can be manipulated:
5
+
Each Drawable (including [`h2d.Bitmap`](https://heaps.io/api/h2d/Bitmap.html)) has several properties that can be manipulated:
6
6
7
7
*`alpha` : this will change the amount of transparency your drawable is displayed with. For instance a value of 0.5 will display a Tile with 50% opacity.
8
8
*`color` : color is the color multiplier of the drawable. You can access its individual channels with (r,g,b,a) components. It is initialy set to white (all components are set to 1.). Setting for instance the (r,g,b) components to 0.5 will make the tile appear darker.
@@ -18,7 +18,7 @@ Each Drawable (including [`h2d.Bitmap`](https://github.com/ncannasse/heaps/blob/
18
18
*`filter` : when a sprite is scaled (upscaled or downscaled), by default Heaps will use the nearest pixel in the Tile to display it. This will create a nice pixelated effect for some games, but might not looks good on your game. You can try to set the filter value to true, which will enable bilinear filtering on the sprite, making it looks less sharp and more smooth/blurry.
19
19
*`shaders` : each `Drawable` can have shaders added to modify their display. Shaders are introduced [here](https://github.com/HeapsIO/heaps/wiki/H2D-Shaders).
20
20
21
-
`Drawable` instances have other properties which can be discovered by visiting the [`h2d.Drawable`](https://github.com/ncannasse/heaps/blob/master/h2d/Drawable.hx) API section.
21
+
`Drawable` instances have other properties which can be discovered by visiting the [`h2d.Drawable`](https://heaps.io/api/h2d/Drawable.html) API section.
22
22
23
23
## Sample
24
24
@@ -31,8 +31,11 @@ A collection of different objects that all inherit from `h2d.Drawable`:
Copy file name to clipboardExpand all lines: First-outlook.md
-2
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,6 @@ There are many samples that haven't yet been added to the site of Heaps. The sam
18
18
19
19
When compiling the `all.hxml` file all samples should get compiled (which currently takes about 227 MB of disk space).
20
20
21
-
Sidenote (Windows): When using HashLink you can run them very quickly when [adding HashLink to your right mouse menues](https://github.com/HaxeFoundation/hashlink/wiki/Further-Tips#working-on-windows).
22
-
23
21
### 👩💻👨💻 Samples from other users
24
22
25
23
You can also learn from external public repositories from other **members of the community**
Copy file name to clipboardExpand all lines: H2D-Events-and-Interactivity.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Events and interaction
2
2
3
-
Making objects interactive (with the mouse) is done creating a [`h2d.Interactive`](api/h2d/Interactive.html) instance. You provide it an interaction area and attach it to a sprite. This can be used to implement **buttons for the UI** but also for any other object that responds on being clicked or hovered (for instance*an old wooden chest* opened by mouse or *an enemy* the player hits by clicking on it).
3
+
Making objects interactive (with the mouse) is done by creating a [`h2d.Interactive`](https://heaps.io/api/h2d/Interactive.html) instance. You provide it with an interaction area and attach it to a sprite. This can be used to implement buttons for the UI, but also for any other object that responds to being clicked or hovered over (for instance, an old wooden chest opened by mouse or an enemy the player hits by clicking on it).
4
4
5
5
```haxe
6
6
var interaction = new h2d.Interactive(300, 100, mySprite);
You can listen to global events (keyboard, touch, mouse, window) by adding event listener to the [`hxd.Window`](api/hxd/Window.html) instance.
26
+
You can listen to global events (keyboard, touch, mouse, window) by adding an event listener to the [`hxd.Window`](https://heaps.io/api/hxd/Window.html) instance.
27
27
28
28
```haxe
29
29
function onEvent(event : hxd.Event) {
30
30
trace(event.toString());
31
31
}
32
32
hxd.Window.getInstance().addEventTarget(onEvent);
33
33
```
34
-
Don't forget to remove the event using removeEventTarget when disposing your objects.
34
+
Don't forget to remove the event using `removeEventTarget` when disposing of your objects.
35
35
36
36
## Keyboard events
37
37
38
-
Keyboard events can be observed using the global event, check if the `event.kind` is `EKeyDown` or `EKeyUp`.
38
+
Keyboard events can be captured using the global event. Check if the `event.kind` is `EKeyDown` or `EKeyUp`.
39
39
40
40
```haxe
41
41
function onEvent(event : hxd.Event) {
@@ -58,7 +58,7 @@ if (Key.isPressed(Key.SPACE)) {
58
58
59
59
## Resize events
60
60
61
-
You can listen to resize events by adding `addResizeEvent` listener to the [`hxd.Window`](api/hxd/Window.html) instance.
61
+
You can listen to resize events by adding `addResizeEvent` listener to the [`hxd.Window`](https://heaps.io/api/hxd/Window.html) instance.
Don't forget to remove the event using removeEventTarget when disposing your objects.
70
+
Don't forget to remove the event using `removeEventTarget` when disposing your objects.
71
71
72
-
All events callbacks in Heaps receive a [`hxd.Event`](api/hxd/Event.html) instance, which contains info about the event.
72
+
All events callbacks in Heaps receive a [`hxd.Event`](https://heaps.io/api/hxd/Event.html) instance, which contains info about the event.
73
73
74
74
## Touch screen
75
75
76
-
[hxd.System.getValue(IsTouch)](api/hxd/System.html#getValue) can be used to detect whether a device has a touch screen or not (currently only detected on mobile devices). This value could be used for example to implement a long press with a timer on touch screen platforms only.
76
+
[hxd.System.getValue(IsTouch)](https://heaps.io/api/hxd/System.html#getValue) can be used to detect whether a device has a touch screen or not (currently only detected on mobile devices). This value could be used for example to implement a long press with a timer on touch screen platforms only.
0 commit comments