All Projects → temoki → TortoiseGraphics

temoki / TortoiseGraphics

Licence: MIT License
A turtle graphics (a key feature of the Logo ) engine written in Swift.

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to TortoiseGraphics

trtl
Tk-powered Ruby turtle graphics
Stars: ✭ 65 (-19.75%)
Mutual labels:  logo, turtle-graphics
custom-login
Custom Login for WordPress.
Stars: ✭ 28 (-65.43%)
Mutual labels:  logo
React-NBA-Logos
React components for NBA team logos 🏀
Stars: ✭ 50 (-38.27%)
Mutual labels:  logo
svg-music-logos
🎧 A collection of logos and symbols from bands, musicians and related in SVG
Stars: ✭ 30 (-62.96%)
Mutual labels:  logo
server-media
This repository collects icons, logos & information about game servers.
Stars: ✭ 29 (-64.2%)
Mutual labels:  logo
simple-icons-pdf
PDF icons for popular brands
Stars: ✭ 16 (-80.25%)
Mutual labels:  logo
CryptoLogos
Hundreds of crypto logos simply named by their normalized contract address
Stars: ✭ 14 (-82.72%)
Mutual labels:  logo
ChannelFiles
Miscellaneous TFL/LL YouTube channel files.
Stars: ✭ 12 (-85.19%)
Mutual labels:  logo
WebRtcShitBlt
client side WebRTC lib to add an image / watermark on the MediaSource
Stars: ✭ 19 (-76.54%)
Mutual labels:  logo
libre-logos
A collection of free logos for open source projects
Stars: ✭ 131 (+61.73%)
Mutual labels:  logo
RideShare-Trip-Stats
Chrome Extension to visualize your uber trip statistics
Stars: ✭ 61 (-24.69%)
Mutual labels:  logo
aframe-lsystem-component
L-System/LSystem component for A-Frame to draw 3D turtle graphics. Using Lindenmayer as backend.
Stars: ✭ 33 (-59.26%)
Mutual labels:  turtle-graphics
branding
Our logos, and other branding material
Stars: ✭ 31 (-61.73%)
Mutual labels:  logo
designs
Blockstack designs
Stars: ✭ 26 (-67.9%)
Mutual labels:  logo
purescript-free-turtle
A toy turtle graphics interpreter based on the Free monad, in PureScript, with HTML Canvas graphics support.
Stars: ✭ 16 (-80.25%)
Mutual labels:  turtle-graphics
uiLogos-sketch-plugin
Sketch plugin to Insert professionally designed dummy logos of companies and 190+ country flag into SketchApp
Stars: ✭ 26 (-67.9%)
Mutual labels:  logo
fish logo
🐠 Fish shell colorful ASCII-art logo
Stars: ✭ 82 (+1.23%)
Mutual labels:  logo
geticon
Web / IT project stack / tool / technique icon / logo collection & markdown / HTML generator 🚀
Stars: ✭ 101 (+24.69%)
Mutual labels:  logo
brand.systemd.io
Website with systemd brand assets
Stars: ✭ 12 (-85.19%)
Mutual labels:  logo
Logo
Logo Tiger Enterprise Özel Raporlar, Tablo ve View Açıklamaları
Stars: ✭ 73 (-9.88%)
Mutual labels:  logo

Swift Xcode Swift Playgrounds Carthage compatible Version License Platform

A turtle graphics (a key feature of the Logo engine written in Swift.

The commands were implemented with reference to the turtle in Python 3 standard libraries.

Example

// Turtle Star!
🐢.beginFill()
36.timesRepeat {
    🐢.forward(200)
    🐢.left(170)
}
🐢.endFill()

Result

Usage

// Instantiate a `Tortoise`
let 🐢 = Tortoise()

// Instantiate `ImageCanvas` and add the tortoise
let canvas = ImageCanvas(size: Vec2D(300, 300))
canvas.add(🐢)

// Command 🐢
🐢.right(90)
🐢.forward(100)

// Get drawn `CGImage`
let cgImage = canvas.cgImage

Playgrounds

On Xcode

  1. Open TortoiseGraphics.xcworkspace in Xcode.
  2. Build TortoiseGraphics scheme for iOS Simulator.
  3. Select Playground in project navigator.
  4. Let's play!

On Swift Playgrounds (iPad app)

Subscription

  1. Launch Safari on your iPad and browse this page.
  2. Tap the following link to subscribe.
  3. You can get Tortoise Graphics playground book on Swift Playgrounds app.

Download

  1. Download TortoiseGraphics.playgroundbook.zip from here.
  2. Unarchive the downloaded zip file.
  3. Send the unarchvied TortoiseGraphics.playgroundbook file to your iPad by AirDrop.
  4. Open it with Swift Playgrounds app.
  5. Let's play!

Classes

  • Tortoise
  • ImageCanvas
  • Shape
  • Color
  • Vec2D

Enums

  • Speed

Tortoise Commands

Motion

Move and Draw

  • forward(), fd()
  • backword(), back(), bk()
  • right(), rt()
  • left(), lt()
  • setPosition(), setPos(), goto()
  • setX()
  • setY()
  • setHeading(), setH()
  • home()
  • circle()

Tell tortoise's state

  • position, pos
  • towards()
  • xcor
  • ycor
  • heading
  • distance()

Pen Control

Drawing state

  • penDown(), pd(), down()
  • penUp(), pu(), up()
  • penSize()
  • width()
  • isDown
  • penSize
  • width

Color control

  • penColor()
  • penColor
  • fillColor()
  • fillColor

Filling

  • filling
  • beginFill()
  • endFill()

More drawing control

  • reset()
  • clear()

Tortoise state

Visiblity

  • showTortoise(), st()
  • hideTortoise(), ht()
  • isVisible
  • shape()
  • shape

Other Commands

  • Int.timesRepeat() {}
  • random()
  • degrees()
  • radians()
  • colorMode(),
  • colorMode

for Playground

  • PlaygroundCanvas
  • PlaygroundCanvasLiveView

for Swift Playgrounds

  • SwiftPlaygroundCanvas
  • LiveViewController

Requirements

  • Swift 5.1 (Xcode 11.1)
  • iOS/iPadOS 13.0 or later

Installation

Carthage

github "temoki/TortoiseGraphics"

Cocoapods

pod 'TortoiseGraphics'

Remaining Work

  • support SVG output
  • macOS support
  • Swift Package Manager support
  • Enrich tortoise commands
  • Enrich playground contents

Credits

  • Special thanks to @kiyoshifuwa, for the amazing art works.

License

TortoiseGraphics is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].