exportSprite之五(Anim,FFrame,FModule)

本文介绍了用于构建动画效果的框架设计,包括Anim类、FFrame类和FModule类的定义及使用方式。Anim类负责管理动画帧序列,FFrame类定义了单个动画帧的属性,而FModule类则用于配置动画模块的基本参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Anim.java文件源码:<wbr style="line-height:25px"><div style="line-height:25px"> <div style="line-height:25px"> <span style="color:#993300; line-height:25px">public class</span><span style="line-height:25px"><span style="color:#993300; line-height:25px">Anim</span></span> </div> <div style="line-height:25px">{</div> <div style="line-height:25px"><br style="line-height:25px"></div> <div style="line-height:25px"> int id = 0;</div> <div style="line-height:25px"> int frameCnt = 0;</div> <div style="line-height:25px"> int kDefaultFFrameSizeMax = 50;</div> <div style="line-height:25px"> FFrame fFrame[];</div> <div style="line-height:25px"> String des="";</div> <div style="line-height:25px"> <span style="color:#FF6600; line-height:25px"></span><span style="line-height:25px"><span style="color:#FF6600; line-height:25px">Anim()</span></span> </div> <div style="line-height:25px"> {</div> <div style="line-height:25px"> fFrame = new FFrame[kDefaultFFrameSizeMax];</div> <div style="line-height:25px"> }</div> <div style="line-height:25px"><br style="line-height:25px"></div> <div style="line-height:25px"> <span style="color:#FF6600; line-height:25px">Anim(int frameSize,String des)</span> </div> <div style="line-height:25px"> {</div> <div style="line-height:25px"> fFrame = new FFrame[frameSize];</div> <div style="line-height:25px"> this.des=des;</div> <div style="line-height:25px"> }</div> <div style="line-height:25px"><br style="line-height:25px"></div> <div style="line-height:25px"> <span style="color:#FF6600; line-height:25px">void appendFrame(FFrame frame)</span> </div> <div style="line-height:25px"> {</div> <div style="line-height:25px"> fFrame[frameCnt++] = frame;</div> <div style="line-height:25px"> }</div> <div style="line-height:25px">}</div> </div> <div style="line-height:25px"><span style="line-height:25px">FFrame.java文件源码</span></div> <div style="line-height:25px"> <span style="line-height:25px"></span> <div style="line-height:25px"><span style="line-height:25px"><span style="color:#993300; line-height:25px">public class FFrame</span>{</span></div> <div style="line-height:25px"><span style="line-height:25px"> int frameId=0;</span></div> <div style="line-height:25px"><span style="line-height:25px"> int time=0;</span></div> <div style="line-height:25px"><span style="line-height:25px"> int x=0;</span></div> <div style="line-height:25px"><span style="line-height:25px"> int y=0;</span></div> <div style="line-height:25px"><span style="line-height:25px"> int flag=0;</span></div> <div style="line-height:25px"><span style="line-height:25px"><span style="color:#FF6600; line-height:25px">FFrame()</span></span></div> <div style="line-height:25px"><span style="line-height:25px"> {</span></div> <div style="line-height:25px"><span style="line-height:25px"> }</span></div> <div style="line-height:25px"><span style="line-height:25px"> <span style="color:#FF6600; line-height:25px">FFrame(int id,int time,int x,int y,int flag)</span></span></div> <div style="line-height:25px"><span style="line-height:25px"> {</span></div> <div style="line-height:25px"><span style="line-height:25px"> frameId=id;</span></div> <div style="line-height:25px"><span style="line-height:25px"> this.x=x;</span></div> <div style="line-height:25px"><span style="line-height:25px"> this.y=y;</span></div> <div style="line-height:25px"><span style="line-height:25px"> this.time=time;</span></div> <div style="line-height:25px"><span style="line-height:25px"> this.flag=flag;</span></div> <div style="line-height:25px"><span style="line-height:25px"> }</span></div> <div style="line-height:25px"><span style="line-height:25px">}</span></div> <div style="line-height:25px"> <span style="line-height:25px"></span> <div style="line-height:22px"><span style="line-height:22px">FModule.java文件源码:</span></div> <div style="line-height:22px"> <span style="line-height:22px"></span> <div style="line-height:22px"><span style="line-height:22px"><span style="color:#993300; line-height:22px">public class FModule</span></span></div> <div style="line-height:22px"><span style="line-height:22px">{</span></div> <div style="line-height:22px"><span style="line-height:22px"><br style="line-height:22px"></span></div> <div style="line-height:22px"><span style="line-height:22px"> int moduleId = 0;</span></div> <div style="line-height:22px"><span style="line-height:22px"> int x = 0;</span></div> <div style="line-height:22px"><span style="line-height:22px"> int y = 0;</span></div> <div style="line-height:22px"><span style="line-height:22px"> int w=0;</span></div> <div style="line-height:22px"><span style="line-height:22px"> int h=0;</span></div> <div style="line-height:22px"><span style="line-height:22px"> int flag = 0;</span></div> <div style="line-height:22px"><span style="line-height:22px"> <span style="color:#FF6600; line-height:22px">FModule()</span></span></div> <div style="line-height:22px"><span style="line-height:22px"> {</span></div> <div style="line-height:22px"><span style="line-height:22px"> }</span></div> <div style="line-height:22px"><span style="line-height:22px"><span style="color:#FF6600; line-height:22px">FModule(int id,int x,int y,int w,int h,int flag)</span></span></div> <div style="line-height:22px"><span style="line-height:22px"> {</span></div> <div style="line-height:22px"><span style="line-height:22px"> moduleId = id;</span></div> <div style="line-height:22px"><span style="line-height:22px"> this.x = x;</span></div> <div style="line-height:22px"><span style="line-height:22px"> this.y = y;</span></div> <div style="line-height:22px"><span style="line-height:22px"> this.w=w;</span></div> <div style="line-height:22px"><span style="line-height:22px"> this.h=h;</span></div> <div style="line-height:22px"><span style="line-height:22px"> this.flag = flag;</span></div> <div style="line-height:22px"><span style="line-height:22px"> }</span></div> <div style="line-height:22px"><span style="line-height:22px">}</span></div> </div> </div> </div> </wbr>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值