Crate dyon_interactive

Crate dyon_interactive 

Source
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>

snake

§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§

FontNames
Wraps font names as a current object.
ImageNames
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