Socket
Socket
Sign inDemoInstall

github.com/franeklubi/tie

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/franeklubi/tie

Package tie provides a Processing-like API for simple and fun drawing, game making, data and algorithm visualization, generally - art :). To start writing a new sketch, You need to initialize the engine first: Then You need to pass the functions You want to act as the ones listed below, in the right order, but only preload, setup, and draw are necessary: To do that, call PassFunctions with the functions You want to use as arguments: The only thing that's left is launching the engine with: The whole sketch should look something like this: For more examples visit https://github.com/franeklubi/tie-examples/


Version published

Readme

Source

franeklubi/tie

GoDoc

logo

Package franeklubi/tie provides a Processing-like API for simple and fun drawing, game making, data and algorithm visualization, and generally - art :)



Installation

To install this package:

go get github.com/franeklubi/tie

You'll also need to install dependencies. (see Dependencies)

Dependencies

This package depends on two other packages:

  • gl v2.1
  • glfw v3.2

To install these, use:

go get github.com/go-gl/gl/v2.1/gl

then

go get github.com/go-gl/glfw/v3.2/glfw

and You should be all set! :)

Features

Main features:

  • it's beginner friendly,
  • has Processing-like API - no need to learn a new framework from the ground up,
  • provides easy image manipulation,
  • it's fun :D

Example

( For more examples visit franeklubi/tie-examples! )

package main

// import the package
import (
    "github.com/franeklubi/tie"
)

func main() {
    // initialize engine in main
    tie.Init(500, 500, "window_name", false)
    //   width, height, window_name, is_resizable

    // pass all the functions you want used by the engine
    tie.PassFunctions(
        preload,
        setup,
        draw,
    )

    // launch the engine
    tie.Launch()
}

var (
    img tie.Image
)

// called only once, before setup, nothing can be drawn here
func preload() {
    img = tie.LoadImage("/path/to/image.png")
}

// called only once, before draw, you can draw here
func setup() {
    tie.Background(255, 255, 255, 255)
}

// called once every frame
func draw() {
    // drawing loaded image
    tie.Fill(255, 255, 255, 255)
    tie.PastePixels(img, 0, 0, tie.Width, tie.Height)

    // drawing ellipse
    tie.Fill(0, 255, 0, 255)
    tie.Ellipse(tie.Width/2, tie.Height/2, 200, 200)

    // drawing rectangle
    tie.Fill(0, 255, 255, 255)
    tie.Rect(tie.Width/2-50, tie.Height/2-50, 100, 100)
}

FAQs

Last updated on 11 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc