sprite和spirit的区别

sprite和spirit的区别,第1张

sprite和spirit的区别

一、读音不同

sprite 英[spraɪt]    美[spraɪt] 

spirit 英[ˈspɪrɪt] 美[ˈspɪrɪt]

二、释义不同

sprite

n(传说中的)小仙子,小精灵,小妖精; 雪碧(商标名);

spirit

n    精神; 心灵; 情绪; 心境; (某种类型的)人; 勇气; 忠心; 心态; 本质; 真实意义; 灵魂; 仙子; 烈酒;

vt    偷偷带走; 让人不可思议地弄走;  

三、词形变化不同

sprite复数:sprites

spirit第三人称单数:spirits 复数:spirits 现在分词:spiriting 过去式:spirited

四、用法不同

sprite通常用于表示一种小型的、有灵性的生物,比如精灵、小妖精等,例如:

1、The sprite danced in the moonlight(小精灵在月光下跳舞。)

2、The little girl is so lovely that I call her a sprite(这个小女孩太可爱了,我把她叫做小精灵。)

spirit可以表示一种酒精饮料,更常用于表示灵魂、精神或情感,例如:

1、They were in low spirits (他们精神不振。)

2、He drank a shot of spirit to calm his nerves(他喝了一杯烈酒来镇定神经。)

五、双语例句

sprite

1、This Sprite has lost its fizz

这瓶雪碧跑气儿了。

2、It is say that little water sprite live In this river

传说这条河里住有小水妖

3、They also provide mineral water, coke and sprite in the room

房间里还有矿泉水、可乐和雪碧。

4、We bought three sprites and then walked back to the room

我们买了三瓶雪碧就回到了房间。

5、Now, focus on just one of these sprites

现在,把注意力集中到其中的一个小精灵。

spirit

1、You must try and keep your spirits up

你必须设法保持高昂的情绪。

2、They took away his freedom and broke his spirit

他们夺去了他的自由,摧垮了他的意志。

3、She took it in the spirit in which it was intended

她根据其精神实质来认识此事。

4、It was believed that people could be possessed by evil spirits

以前,人们相信人有可能被恶魔缠身。

5、We approached the situation in the wrong spirit

我们以前对待局势的心态不对。

在unity的sprite中贴图的方法如下:
在SpriteAnimatorcs脚本中添加代码
using UnityEngine;
using SystemCollections;

/// Sprite 动画播放器
public class SpriteAnimator : MonoBehaviour {

/// Sprite渲染器
protected SpriteRenderer m_sprite;
/// Sprite动画帧
protected Sprite[] m_clips;
/// 动画计时器(默认每隔01秒更新一帧)
protected float timer = 01f;
/// 贴图文件名前缀
public string m_sprite_name = "player00";
/// 贴图文件起始帧数字
public int m_start_frame = 0;
/// 动画的帧数
public int m_frame_count =8;
/// 跳帧数量
public int m_offset_frame = 4;
/// 当前的帧数
protected int m_frame = 0;
}
SpriteRenderer是Sprite的渲染器,只有通过它才能在屏幕上显示出Sprite的图像。
m_clips是一个Sprite数组,用来保存动画所需要的Sprite。
在这个例子中,我们使用的动画贴图文件命名都采用数字后缀,表示动画帧,并且跳帧,如“player0016,player0020,player0024……”。m_start_frame表示第一帧的数字,在这个例子中是指16, m_offset_frame表示跳帧,在这个例子中是指4。出现跳帧数字是因为这些图像都是通过3D软件渲染而成,在渲染的时候进行了跳帧设置,否则这个动画需要几十张来表现。
void Start () {
// 初始化动画帧数组
m_clips = new Sprite[m_frame_count];
for (int i = 0; i < m_frame_count; i++)
{
// 当前帧
int currentframe = m_start_frame + i m_offset_frame;
// 计算贴图名称
string spritename = stringFormat(m_sprite_name + "{0:D2}", currentframe);
// 从Resources目录读取贴图
Texture2D texture = (Texture2D)ResourcesLoad(spritename);
// 由贴图创建出Sprite
m_clips[i] = SpriteCreate(texture,
new Rect(0, 0, texturewidth, textureheight),
new Vector2(05f, 02f));
}
// 为当前GameObject添加一个Sprite渲染器
m_sprite = thisgameObjectAddComponent<SpriteRenderer>();
// 设置第1帧的Sprite
m_spritesprite = m_clips[m_frame];
}

简单……
/腾讯游戏/地下城与勇士/ImagePack2文件夹:
sprite_map_cutsceneNPK 城镇和载入图背景
sprite_worldmapNPK 进入地下城背景图
sprite_interfaceNPK:背景主文件
(createcharacterimg 创建角色背景图
newselectcharacterimg 选择频道背景文件名)
sprite_interface_newstyle_windows_chattingNPK聊天框背景文件 114个
然后用DNF_Extractor读取里面的NPK文件
DNF_Extractor下载地址:>

这个只要判断做好就比较简单了(话说这个if 有点多 大概思想是这个 看不下去就自己优化下吧)点击的时候调用协程就可以了 (比如下图)

按钮不好调用协程的话 写个方法 调用协程 按钮调用那个方法

下面帖代码:

public Image[] images;//image的数组(需要的话可以动态获取 也可以手托)

public Sprite[] sprites;//sprite的数组(同上)

WaitForSeconds wait;

public   float waitTime=1;//等待时间

int tim;//计次的参数

private void Start()

{

tim = 0;

wait = new WaitForSeconds(waitTime);

}

IEnumerator WaitChangeImage()

{

tim++;

ChangeImage();

yield return wait;

if (tim < spritesLength)

{

StartCoroutine(WaitChangeImage());

}

}

private void ChangeImage()

{

for (int i = 0; i <imagesLength ; i++)

{

if (tim < imagesLength)

{

if (imagesLength - tim + i < imagesLength)

{

if (i < spritesLength)

{

images[imagesLength - tim + i]sprite = sprites[i];

}

else

{

images[imagesLength - tim + i]sprite = null;

}

}

}

else

{

if (i + tim - imagesLength < spritesLength)

{

images[i]sprite = sprites[i + tim - imagesLength];

}

else

{

images[i]sprite = null;

}

}

}

}

图的话回调协程没有限制 之后代码上补上了…… 如果想要最后一张图跑完全部image的话

在协程下面 改回调协程的限制为下面的就可以了

if (tim < spritesLength+imagesLength)

{

StartCoroutine(WaitChangeImage());

}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/13387676.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-26
下一篇 2023-07-26

发表评论

登录后才能评论

评论列表(0条)

保存