https://github.com/franeklubi/tie
Package franeklubi/tie provides a Processing-like API for simple and fun drawing, game making, data and algorithm visualization, and generally - art :)
https://github.com/franeklubi/tie
2d-graphics 3d-graphics go golang graphics processing tie
Last synced: about 1 year ago
JSON representation
Package franeklubi/tie provides a Processing-like API for simple and fun drawing, game making, data and algorithm visualization, and generally - art :)
- Host: GitHub
- URL: https://github.com/franeklubi/tie
- Owner: franeklubi
- License: mit
- Created: 2018-12-11T10:50:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-11T20:46:23.000Z (over 7 years ago)
- Last Synced: 2025-03-25T20:11:46.218Z (about 1 year ago)
- Topics: 2d-graphics, 3d-graphics, go, golang, graphics, processing, tie
- Language: Go
- Homepage:
- Size: 215 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# franeklubi/tie
[](https://godoc.org/github.com/franeklubi/tie)

Package `franeklubi/tie` provides a Processing-like API for simple and fun drawing,
game making, data and algorithm visualization, and generally - art :)
---
* [Installation](#installation)
* [Dependencies](#dependencies)
* [Features](#features)
* [Example](#example)
---
## Installation
To install this package:
```sh
go get github.com/franeklubi/tie
```
You'll also need to install dependencies. (see [Dependencies](#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](https://github.com/franeklubi/tie-examples/)! )
```go
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)
}
```