Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Draw a line or something else in spritekit ?

Hi,

I have a wordsearch game that i try to convert to spritekit. When a user slide the finger on a word, the game should draw a line.

With Uikit, i have use the CGContextSetLineCap and KCGLineCapRound to draw a round corner line and allow some transparency.

With spritekit i'm a bit lost. I have found SKShapeNode and CGPathMoveToPoint to draw the line but there is no round corners. I have try CGPathCreateWithRoundedRect but i don't have found a easy way to draw diagonal lines with this method.

In fact, if there is a way to draw a line with some effect or texture like chalkdust or orther cool things to highlight the word, it would be awesome. But i'm pretty new to spritekit and i don't know what is possible or not.

I hope someone can help me, it's the only part i have to make to finish my update.
Tagged:

Replies

  • ubunterosubunteros Posts: 40 @
    I just have found a way with CGPathCreateCopyByStrokingPath, there is a var into to set kCGLineCapRound.

    I still let the question open to know if i can apply some texture on it. I have read that SKShapeNode are not very optimized, if i could do the same line with SKSpriteNode, it would be nice to avoid some bugs.
Sign In or Register to comment.