Expand description
§Dyon-Interactive
A library for interactive coding with the Piston game engine
fn main() {
set_window(size: (120, 120))
~ draw_list := []
loop {
if !next_event() {break}
if render() {
clear(color: #ffffff)
rectangle(color: #ff0000, corner: (10, 10), size: (100, 100))
draw(draw_list)
clear(mut draw_list)
}
}
}DYON-API | LICENSE-APACHE | LICENSE-MIT
§Introduction
Install: cargo install piston-dyon_interactive --example dyongame
Run script: dyongame <file.dyon>

§License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
§Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.
Structs§
- Font
Names - Wraps font names as a current object.
- Image
Names - Wraps image names as a current object.
Constants§
- CNGG
- CNOLOM
- EXPECTED_
FONT - EXPECTED_
FONT_ ID_ OR_ OBJECT - EXPECTED_
IMAGE_ ID_ OR_ OBJECT - EXPECTED_
RGBA_ IMAGE - EXPECTED_
TEXTURE - FONT_
ID_ IS_ OFB - IMAGE_
ID_ IS_ OFB - NO_
EVENT - PIXEL_
IS_ OFB
Functions§
- add_
functions - Adds functions to module, using a generic backend.
- after_
render - create_
image__ name_ size - create_
image__ size - cursor
- cursor_
arg - draw_2d
- Helper method for drawing 2D in Dyon environment.
- event_
loop_ benchmode - event_
loop_ lazy - event_
loop_ maxfps - event_
loop_ swapbuffers - event_
loop_ ups - event_
loop_ upsreset - focus
- focus_
arg - font_
names - graphics2d_
source - idle
- idle_dt
- image_
names - image_
size - load_
image - load_
image_ obj - mouse_
cursor - mouse_
cursor_ pos - press
- press_
keyboard_ key - press_
mouse_ button - pxl__
image_ pos - pxl__
image_ pos_ color - release
- release_
keyboard_ key - release_
mouse_ button - render
- render_
ext_ dt - render_
source - resize
- save__
image_ file - set_
event_ loop__ benchmode - set_
event_ loop__ lazy - set_
event_ loop__ maxfps - set_
event_ loop__ swapbuffers - set_
event_ loop__ ups - set_
event_ loop__ upsreset - set_
window__ position - set_
window__ size - set_
window__ title - swap_
buffers - text
- text_
arg - update
- update_
dt - width__
font_ size_ string - window_
draw_ size - window_
position - window_
size - window_
title