Skip to content

sabiland/TrippyBackgrounds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrippyBackgrounds - iOS

For the recent iOS game I am developing I wrote a simple helper class for my game to generate totaly random image for a scene background. I think the outcome is really nice and useful for backgrounds, textures, etc.

So I've uploaded a sample SpriteKit project if anyone would be interested to use it.

Class responsible for creating image is

SabilandTB.swift

Usage (generated image is SQUARE -> max(width, height))

// NOTE: WIDTH and HEIGHT must be >= 1.0
let generator = SabilandTB(width: 500.0, height: 200.0)
let trippyImage = generator.SabilandTrippyBackground

Example how to use it in a SpriteKit game as a background image

let background = SKNode()
background.addChild(SKSpriteNode(texture: SKTexture(CGImage: trippyImage.CGImage!)))
background.position = CGPointMake(MasterSKView.frame.midX, MasterSKView.frame.midY)
self.addChild(background)

Examples of fully-randomly-generated images. These are just a few examples.

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

About

iOS - Easy way to create random-trippy background images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages