Code Monkey home page Code Monkey logo

skscene_background_pattern's Introduction

SKScene_Background_Pattern

Since iOS' SKView.scene is currently not supporting UIColor (pattern: image) a workaround

#Credits# Based on this tutorial: http://xcodenoobies.blogspot.nl/2015/08/skspritekit-how-to-fill-skscene.html by emir Bytes https://plus.google.com/102798309408233437491/posts

I've created a swift function addBackgroundPattern()

#Background pattern credit# I used paisley.png image from http://subtlepatterns.com as a great example of a tileable image.

#What it does# It takes a background image and tiles it on the background of a SKView. The FPS on a real device is still 60FPS.

in the viewDidLoad of the viewcontroller presenting the SKScene, just call the addBackgroundPattern() function and voila - there it will add the tiles.

#Why not use UIColor( imagepattern)?# In other views you can just create a UIColor with an imagepattern and setBackgroundColor to that UIColor e.g. http://ddeville.me/2010/12/uicolor-with-pattern-image/ by Damien DeVille (https://github.com/ddeville) In SKView that just doesn't work.

#Tags# SKView, tiles, background, pattern, image, black, uicolor, tiled, patterned background, skview.scene

skscene_background_pattern's People

Contributors

onstwedder avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.