Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. iOS
  4. I try to create a path between two planets, I have no compilation error but I do not understand why there is nothing that appears on my simulator

I try to create a path between two planets, I have no compilation error but I do not understand why there is nothing that appears on my simulator

Scheduled Pinned Locked Moved iOS
swiftgame-devhelp
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_14197715
    wrote on last edited by
    #1

    I create a mobile shooting video game, I would like to create a line between each planet (8 planets in total) to form a path but I do not understand why my line does not appear. Here is my code: I want to say that I start in Swift and Spritekit.

    Here is my code

    var line = SKShapeNode()
    let path = CGMutablePath()
    path.addLines(between: [CGPoint(x: size.width * 0.3 , y: size.height * 0.9), CGPoint(x: self.size.width/2, y: self.size.height/1.22)])
    line.path = bezierPath.cgPath
    line.strokeColor = SKColor.red
    line.lineWidth = 2
    addChild(line)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups