-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
86 changed files
with
4,825 additions
and
3,671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
docs/src/content/docs/reference/Shape/properties/dimensions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
--- | ||
title: Shape.dimensions | ||
description: An xy value for the dimensions of the shape (only square right now). | ||
title: Shape.size | ||
description: An xy value for the size of the shape (only square right now). | ||
--- | ||
|
||
An xy value for the dimensions of the shape (only square right now). | ||
An xy value for the size of the shape (only square right now). | ||
|
||
Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
module CameraModule | ||
using JulGame | ||
using .Math | ||
|
||
export Camera | ||
mutable struct Camera | ||
size::Vector2 | ||
offset::Vector2f | ||
position::Vector2f | ||
startingCoordinates::Vector2f | ||
|
||
target::Union{ | ||
Ptr{Nothing}, | ||
JulGame.TransformModule.Transform | ||
} | ||
windowPos::Vector2 | ||
|
||
function Camera(size::Vector2, initialPosition::Vector2f, offset::Vector2f, target) | ||
this = new() | ||
|
||
this.size = size | ||
this.position = initialPosition | ||
this.offset = Vector2f(offset.x, offset.y) | ||
this.target = target | ||
this.startingCoordinates = Vector2f() | ||
this.windowPos = Vector2(0,0) | ||
|
||
return this | ||
end | ||
end | ||
|
||
function update(this::Camera, newPosition) | ||
SDL2.SDL_SetRenderDrawColor(Renderer, MAIN.cameraBackgroundColor[1], MAIN.cameraBackgroundColor[2], MAIN.cameraBackgroundColor[3], SDL2.SDL_ALPHA_OPAQUE); | ||
SDL2.SDL_RenderFillRectF(Renderer, Ref(SDL2.SDL_FRect(this.windowPos.x, this.windowPos.y, this.size.x, this.size.y))) | ||
|
||
if this.target != C_NULL && newPosition == C_NULL | ||
targetPos = this.target.position | ||
center = Vector2f(this.size.x/SCALE_UNITS/2, this.size.y/SCALE_UNITS/2) | ||
targetScale = this.target.scale | ||
this.position = targetPos - center + 0.5 * targetScale + this.offset | ||
return | ||
end | ||
if newPosition == C_NULL | ||
return | ||
end | ||
this.position = newPosition | ||
end | ||
|
||
function set_target(this::Camera, target) | ||
this.target = target | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
function add_animator end | ||
function add_circle_collider end | ||
function add_click_event end | ||
function add_collider end | ||
function add_collision_event end | ||
function add_rigidbody end | ||
function add_script end | ||
function add_shape end | ||
function add_sound_source end | ||
function add_sprite end | ||
function append_array end | ||
function apply_forces end | ||
function center_text end | ||
function check_collisions end | ||
function create_sound_source end | ||
function destroy end | ||
function draw end | ||
function flip end | ||
function get_last_update end | ||
function get_offset end | ||
function get_parent end | ||
function get_position end | ||
function get_rotation end | ||
function get_scale end | ||
function get_size end | ||
function get_tag end | ||
function get_type end | ||
function get_velocity end | ||
function handle_event end | ||
function initialize end | ||
function load_button_sprite_editor end | ||
function load_font end | ||
function load_image end | ||
function load_sound end | ||
function render end | ||
function set_color end | ||
function set_last_update end | ||
function set_offset end | ||
function set_parent end | ||
function set_position end | ||
function set_rotation end | ||
function set_scale end | ||
function set_size end | ||
function set_sprite end | ||
function set_tag end | ||
function stop_music end | ||
function toggle_sound end | ||
function unload_sound end | ||
function update end | ||
function update_array_value end | ||
function update_font_size end | ||
function update_text end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.