-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a few bugs and added in .CopySurface
- Loading branch information
1 parent
b301200
commit 6b5b207
Showing
11 changed files
with
135 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
show_debug_overlay(true); | ||
background = layer_background_get_id("Background"); | ||
surf = new Canvas(512, 512).WriteToCache(false); | ||
surf.Start(); | ||
draw_rectangle_colour(32, 32,surf.GetWidth(),surf.GetHeight(), c_red, c_green, c_blue, c_yellow, false); | ||
surf.Finish(); | ||
__prevStatus = 0; | ||
myBuffer = -1; |
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,9 @@ | ||
draw_surface(surf.GetSurfaceID(), 0, 0); | ||
var _string = @"Cache Canvas: Space | ||
Update Surface: Control | ||
Resize Surface: W | ||
Get Surface Cache Contents: E (Space for Cached) | ||
Set Surface Cache Contents: Q | ||
Copy Application Surface: V" | ||
|
||
draw_text(8,8, _string); |
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 @@ | ||
draw_text(8,8, "Canvas Status: " + string(__prevStatus)); |
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,39 @@ | ||
if (keyboard_check_released(vk_space)) { | ||
surf.Cache(); | ||
} | ||
|
||
if (keyboard_check(vk_control)) { | ||
surf.Start(); | ||
var _offset = (current_time / 1000); | ||
draw_rectangle_colour(32,32,412,412, make_colour_hsv(_offset mod 256, 255, 255), make_colour_hsv(_offset * 20 mod 256, 255, 255), make_colour_hsv(_offset * 30 mod 256, 255, 255), make_colour_hsv(_offset * 40 mod 256, 255, 255), false); | ||
} | ||
|
||
if (keyboard_check_released(ord("E"))) { | ||
if (keyboard_check(vk_space)) { | ||
surf.Cache(); | ||
} | ||
if (buffer_exists(myBuffer)) { | ||
buffer_delete(myBuffer); | ||
} | ||
myBuffer = surf.GetBufferContents(); | ||
} | ||
|
||
if (keyboard_check_released(ord("W"))) { | ||
surf.Resize(1024, 1024); | ||
surf.Start(); | ||
draw_rectangle_colour(32,32,surf.GetWidth(),surf.GetHeight(), c_red, c_green, c_blue, c_yellow, false); | ||
surf.Finish(); | ||
} | ||
|
||
if (keyboard_check_released(ord("Q"))) { | ||
surf.SetBufferContents(myBuffer); | ||
} | ||
|
||
if (keyboard_check_released(ord("V"))) { | ||
surf.CopySurface(application_surface, 0, 0, true); | ||
} | ||
|
||
__prevStatus = surf.GetStatus(); | ||
if (surf.GetStatus() == CanvasStatus.IN_USE) { | ||
surf.Finish(); | ||
} |
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 @@ | ||
layer_background_blend(background, make_color_hsv(current_time / 100, 255, 255)); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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