Skip to content

Commit 8b8a3b5

Browse files
committed
Shape docs added
1 parent f1653f6 commit 8b8a3b5

File tree

12 files changed

+148
-11
lines changed

12 files changed

+148
-11
lines changed

docs/.astro/types.d.ts

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ declare module 'astro:content' {
235235
collection: "docs";
236236
data: InferEntrySchema<"docs">
237237
} & { render(): Render[".md"] };
238-
"reference/Collider/properties/animations.md": {
239-
id: "reference/Collider/properties/animations.md";
240-
slug: "reference/collider/properties/animations";
238+
"reference/Collider/properties/collisionEvents.md": {
239+
id: "reference/Collider/properties/collisionEvents.md";
240+
slug: "reference/collider/properties/collisionevents";
241241
body: string;
242242
collection: "docs";
243243
data: InferEntrySchema<"docs">
@@ -256,6 +256,69 @@ declare module 'astro:content' {
256256
collection: "docs";
257257
data: InferEntrySchema<"docs">
258258
} & { render(): Render[".md"] };
259+
"reference/Shape/properties/color.md": {
260+
id: "reference/Shape/properties/color.md";
261+
slug: "reference/shape/properties/color";
262+
body: string;
263+
collection: "docs";
264+
data: InferEntrySchema<"docs">
265+
} & { render(): Render[".md"] };
266+
"reference/Shape/properties/dimensions.md": {
267+
id: "reference/Shape/properties/dimensions.md";
268+
slug: "reference/shape/properties/dimensions";
269+
body: string;
270+
collection: "docs";
271+
data: InferEntrySchema<"docs">
272+
} & { render(): Render[".md"] };
273+
"reference/Shape/properties/isFilled.md": {
274+
id: "reference/Shape/properties/isFilled.md";
275+
slug: "reference/shape/properties/isfilled";
276+
body: string;
277+
collection: "docs";
278+
data: InferEntrySchema<"docs">
279+
} & { render(): Render[".md"] };
280+
"reference/Shape/properties/offset.md": {
281+
id: "reference/Shape/properties/offset.md";
282+
slug: "reference/shape/properties/offset";
283+
body: string;
284+
collection: "docs";
285+
data: InferEntrySchema<"docs">
286+
} & { render(): Render[".md"] };
287+
"reference/Shape/properties/parent.md": {
288+
id: "reference/Shape/properties/parent.md";
289+
slug: "reference/shape/properties/parent";
290+
body: string;
291+
collection: "docs";
292+
data: InferEntrySchema<"docs">
293+
} & { render(): Render[".md"] };
294+
"reference/Shape/shape.md": {
295+
id: "reference/Shape/shape.md";
296+
slug: "reference/shape/shape";
297+
body: string;
298+
collection: "docs";
299+
data: InferEntrySchema<"docs">
300+
} & { render(): Render[".md"] };
301+
"reference/SoundSource/properties/acceleration.md": {
302+
id: "reference/SoundSource/properties/acceleration.md";
303+
slug: "reference/soundsource/properties/acceleration";
304+
body: string;
305+
collection: "docs";
306+
data: InferEntrySchema<"docs">
307+
} & { render(): Render[".md"] };
308+
"reference/SoundSource/sound-source.md": {
309+
id: "reference/SoundSource/sound-source.md";
310+
slug: "reference/soundsource/sound-source";
311+
body: string;
312+
collection: "docs";
313+
data: InferEntrySchema<"docs">
314+
} & { render(): Render[".md"] };
315+
"release-notes/v0.0.4.md": {
316+
id: "release-notes/v0.0.4.md";
317+
slug: "release-notes/v004";
318+
body: string;
319+
collection: "docs";
320+
data: InferEntrySchema<"docs">
321+
} & { render(): Render[".md"] };
259322
};
260323

261324
};

docs/astro.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ export default defineConfig({
1515
github: 'https://github.com/Kyjor/JulGame.jl'
1616
},
1717
sidebar: [{
18+
label: 'Release Notes',
19+
collapsed: true,
20+
autogenerate: {
21+
directory: 'release-notes',
22+
collapsed: true
23+
}
24+
},
25+
{
1826
label: 'Getting Started',
1927
items: [
2028
// Each item here is one entry in the navigation menu.
@@ -24,6 +32,7 @@ export default defineConfig({
2432
}]
2533
}, {
2634
label: 'Guides',
35+
collapsed: true,
2736
items: [
2837
// Each item here is one entry in the navigation menu.
2938
{
@@ -32,6 +41,7 @@ export default defineConfig({
3241
}]
3342
}, {
3443
label: 'API Reference',
44+
collapsed: true,
3545
autogenerate: {
3646
directory: 'reference',
3747
collapsed: true

docs/src/content/docs/general/what-is-julgame.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description: An explanation of the engine, along with it's current features and
99

1010
![JulGameEditor](https://github.com/Kyjor/JulGame.jl/assets/13784123/c4ad139f-4d78-47f9-9d13-7bfd150e81bf)
1111

12-
Documentation coming soon!
1312

1413
[Example Repo](https://github.com/Kyjor/JulGame-Example)
1514

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Shape.color
3+
description: An rgb value for the color of the given shape.
4+
---
5+
6+
An rgb value for the color of the given shape.
7+
8+
Example:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Shape.dimensions
3+
description: An xy value for the dimensions of the shape (only square right now).
4+
---
5+
6+
An xy value for the dimensions of the shape (only square right now).
7+
8+
Example:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Shape.isFilled
3+
4+
description: A flag that determines whether or not the shape is filled or not.
5+
---
6+
7+
A flag that determines whether or not the shape is filled or not.
8+
Example:
9+
10+
Code behind:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Shape.offset
3+
description: An xy value for the difference in position between the shape and its parent transform.
4+
---
5+
6+
An xy value for the difference in position between the shape and its parent transform.
7+
Example:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Shape.parent
3+
description: The parent entity of the shape.
4+
---
5+
6+
The parent entity of the shape.
7+
Example:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Shape
3+
description: Shape properties and methods.
4+
sidebar:
5+
order: 1
6+
---
7+
8+
### Properties
9+
10+
| Property | Description |
11+
|-------------------------------------------------------------------------------|---------------------------------------------------------------------------|
12+
| [color](/JulGame.jl/reference/shape/properties/color/) | An rgb value for the color of the given shape. |
13+
| [dimensions](/JulGame.jl/reference/shape/properties/dimensions/) | An xy value for the dimensions of the shape (only square right now). |
14+
| [isFilled](/JulGame.jl/reference/shape/properties/isFilled/) | A flag that determines whether or not the shape is filled or not. |
15+
| [offset](/JulGame.jl/reference/shape/properties/offset/) | An xy value for the difference in position between the shape and its parent transform. |
16+
| [parent](/JulGame.jl/reference/shape/properties/parent/) | An rgb value for the color of the given shape. |
17+
18+
19+
### Public Methods
20+
21+
| Method | Description |
22+
|-----------------------------------------------------------------------|---------------|
23+
| [N/A]() | To be written |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: JulGame Release Notes v0.0.4
3+
description: Release notes
4+
---
5+
6+
- Customizable resolution
7+
- Customizable camera resolution
8+
- Global variables can be passed through entry file

src/Component/Shape.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ module ShapeModule
88
isFilled::Bool
99
offset::Math.Vector2
1010
parent::Any # Entity
11-
position::Math.Vector2
12-
renderer::Union{Ptr{Nothing}, Ptr{SDL2.LibSDL2.SDL_Renderer}}
1311

1412
function Shape(dimensions::Math.Vector2 = Math.Vector2(1,1), color::Math.Vector3 = Math.Vector3(255,0,0), isFilled::Bool = true, offset::Math.Vector2 = Math.Vector2())
1513
this = new()
@@ -26,7 +24,7 @@ module ShapeModule
2624
function Base.getproperty(this::Shape, s::Symbol)
2725
if s == :draw
2826
function()
29-
if MAIN.renderer == C_NULL #|| this.renderer == Ptr{nothing}
27+
if MAIN.renderer == C_NULL
3028
return
3129
end
3230

@@ -41,10 +39,6 @@ module ShapeModule
4139
this.isFilled ? SDL2.SDL_RenderFillRect( MAIN.renderer, outlineRect) : SDL2.SDL_RenderDrawRect( MAIN.renderer, outlineRect);
4240

4341
end
44-
elseif s == :injectRenderer
45-
function(renderer::Ptr{SDL2.LibSDL2.SDL_Renderer})
46-
this.renderer = renderer
47-
end
4842
elseif s == :setParent
4943
function(parent::Any)
5044
this.parent = parent

0 commit comments

Comments
 (0)