Sprite Kit艺术资产命名约定 [英] Sprite Kit art assets naming convention

查看:133
本文介绍了Sprite Kit艺术资产命名约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

制作我的第一个Sprite Kit游戏&差不多完成了.刚完成我的图像.问题是,随着iPhone 6及更高版本的加入, 6 Plus,我在解决如何命名游戏资产时遇到问题.例如,我的几个背景图像之一称为"1MBack.png".有时人们会写"Default–568h@2x.png",我试图弄清楚我的游戏资产名称中是否需要"Default–568h"部分.我为艺术使用的命名约定如下:

Making my 1st Sprite Kit game & almost finished it. Just getting my images finalized. Problem is, with the addition of iPhone 6 & 6 Plus, I am having issues figuring out how to name my game assets. For instance, one of my several background images is called "1MBack.png". Sometimes people write "Default–568h@2x.png" and I try to figure out if I need the "Default–568h" part in my game asset names. The naming convention I used for my art is as following:

<< 1倍(iPhone 2G,3G,3GS)= 1MBack.png >><< 2x(iPhone 4,4s)= 1MBack@2x.png(640x1136)>><<视网膜4 2x(iPhone 5、5s)= 1MBack@2x.png(750x1334)>><< 3倍(iPhone 6 Plus)= 1MBack@3x.png >>

<< 1x (iPhone 2G, 3G, 3GS) = 1MBack.png >> << 2x (iPhone 4, 4s) = 1MBack@2x.png (640x1136) >> << Retina 4 2x (iPhone 5, 5s) = 1MBack@2x.png (750x1334) >> << 3x (iPhone 6 Plus) = 1MBack@3x.png >>

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

Did I name my image's correctly? What about iPhone 6 - do I name an image for it 1MBack@2x.png or 1MBack-667h@2x.png? It's important to me to get these names right because I sat for quite a while making each asset for each screen and want them utilized accordingly.

最后一个问题:在photoshop中制作资产时,在我调整尺寸时,我根据要在其上使用资产的屏幕的PPI来选择PPI.因此,1x(iPhone 2G,3G,3GS)1MBack.png的PPI为163.2x(iPhone 4、4s)1MBack@2x.png的PPI为326.这是正确的吗?我也担心这一点,因为我读到有人在PPI 72中撰写资产的文章.

One final question: when making the assets in photoshop, as I was sizing them, I choose PPI according to the PPI of the screen the asset would be used on. So the 1x (iPhone 2G, 3G, 3GS) 1MBack.png has a PPI of 163. The 2x (iPhone 4, 4s) 1MBack@2x.png has a PPI of 326. Is this correct? I'm worried about this also, because I read someone writing to make assets in PPI 72. Please clarify this.

推荐答案

为宽屏图像(新iPhone)(如名称-视网膜)设置不同的名称

Set different name for Widescreen images(new iPhones) like 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
        }
    }
}

这篇关于Sprite Kit艺术资产命名约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆