Skip to content

Creative Coding with the Julia programming language.

License

Notifications You must be signed in to change notification settings

dylanxyz/Tela.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tela.jl

Creative Coding with the Julia programming language.

Tela.jl is a Julia package inspired by Processing and p5.js, designed to be easy to use for programmers and non programmers (artists, students, etc) to build interactive applications, visualizations, simulations, games and computer generated art.

Warning: this project is in a very early stage and under development.

Installation

Tela is a   Julia Language   package. To install Tela, open Julia's interactive session (known as REPL) and press ] key in the REPL to use the package mode, then type the following command:

pkg> add https://github.com/dylanxyz/Tela.jl

Note that Tela is not yet at the public registry, installation is done directly from this repo.

Quick Example

using Tela

# Use the setting" macro to set common application settings,
# such as the window title, width, height, etc...

setting"title"  = "[Example] Basic"
setting"width"  = 800
setting"height" = 600

# setup will be called once the application is initialized.
setup(::App) = background(rgb(12))

# update will be called every frame.
function update(::App)
    # Check if a particular mouse button is being pressed
    if isdown(mouse"left")
        hue = 360 * (cos/12 * @seconds) + 1)
        fillcolor(hsl(hue, 0.75, 0.65))
        circle(@mouse[x], @mouse[y], 32, :fill)
    end

    isdown(mouse"right") && background(rgb(12))

    # Top header
    fillcolor(rgb(10))
    rect(0, 0, @width, 30, :fill)

    fillcolor(rgb(244))
    textalign(:top, :left)
    fontface("sans")
    text("Hold Mouse Left 🖱️ to draw | Press Mouse Right 🖱️ to clear", 10, 10)
end

# Runs the application.
#
# Basically, this macro will look at the functions you defined and
# add them as callback listeners to specific Tela events, based on
# their name.
#
# So for example, the setup and update functions defined above will
# be added to the setup and update Tela events, respectively.
Tela.@run()

Documentation

In progress...

License

Tela.jl is licensed under the MIT License.

Additional license for assets:

About

Creative Coding with the Julia programming language.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages