【问题标题】:Sprite Kit art assets naming conventionSprite Kit 艺术资源命名约定
【发布时间】:2014-11-03 19:11:47
【问题描述】:

制作我的第一个 Sprite Kit 游戏并且几乎完成了。只是让我的图像最终确定。问题是,随着 iPhone 6 和 6 Plus 的加入,我无法确定如何命名我的游戏资产。例如,我的几个背景图像之一称为“1MBack.png”。有时人们会写“Default–568h@2x.png”,而我试图弄清楚我的游戏资产名称中是否需要“Default–568h”部分。我为我的艺术使用的命名约定如下:

> > > >

我的图片命名是否正确? iPhone 6 怎么样?我应该将图像命名为 1MBack@2x.png 还是 1MBack-667h@2x.png?正确命名这些名称对我来说很重要,因为我坐了很长时间为每个屏幕制作每个资产,并希望它们得到相应的利用。

最后一个问题:在 Photoshop 中制作资产时,在调整它们的大小时,我会根据要使用资产的屏幕的 PPI 来选择 PPI。所以 1x (iPhone 2G, 3G, 3GS) 1MBack.png 的 PPI 为 163。2x (iPhone 4, 4s) 1MBack@2x.png 的 PPI 为 326。这是正确的吗?我也担心这一点,因为我读到有人写了 PPI 72 中的资产。请澄清这一点。

【问题讨论】:

    标签: ios objective-c sprite-kit png iphone-6


    【解决方案1】:

    为宽屏图像(新 iPhone)设置不同的名称,例如 name-retina

    -(void)didMoveToView:(SKView *)view
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
            CGSize result = [[UIScreen mainScreen] bounds].size;
            if (result.height == 480) {//Old iPhone detected
            SKSpriteNode *bg = [SKSpriteNode spriteNodeWithImageNamed:@"1MBack"];//2G, 3G, 3GS
            //By the way you have to set different sprite position for devices here   
            }else{//New iPhone detected
            SKSpriteNode *bg = [SKSpriteNode spriteNodeWithImageNamed:@"1MBack-retina"];//5, 5S, 6, 6Plus
            }
        }
    }
    

    【讨论】:

    • 谢谢。我想我会放弃对 2G、3G 和 3GS 的支持。对了,iPhone 4, 4s = image.png & iPhone 5, 5s, 6 = image@2x.png & iPhone 6+ = image@3x.png 那么呢?
    • iPhone 4,4s image@2x.png | iPhone 5、6 图片-retina@2x | iPhone 6+ 图像-视网膜@3x。欢迎您:)
    猜你喜欢
    • 2023-03-02
    • 2016-07-21
    • 1970-01-01
    • 2022-01-16
    • 2019-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多