Gho*_*ost 56 size assets image ios swift
我是Swift的新手,我想从资产中加载一个特殊的图像.例如,我有:
image 1 for iphone 4s = green-square@2x.png
image 2 for iphone 5/5s = green-square-Retina@2x.png
image 3 for iphone 6s = green-square@3x.png
Run Code Online (Sandbox Code Playgroud)
我想为iphone 6加载一个特定的图像
self.GSquare = SKSpriteNode(imageNamed: "./Images.xcassets/green-square-Retina@2x.png")
Run Code Online (Sandbox Code Playgroud)
可能吗?
Aza*_*zat 99
你不应该直接加载图像@2x或@3x,系统会自动选择合适的图像,你只需要指定名称,如UIImage(named: "green-square-Retina")
| 归档时间: |
|
| 查看次数: |
79110 次 |
| 最近记录: |