




免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Animation Components Ball ImageSpriteBallA ball component is a particular kind of sprite (animated object) that looks like a ball.A ball is a round sprite that is contained by a canvas, can react to touches and drags, interact with other sprites (image sprites and other balls) and the edge of the canvas, and move according to its properties. For example, to have a ball move 4 pixels toward the top of a canvas every 500 milliseconds (half second), you can set theSpeedproperty to 4, theIntervalproperty to 500, theHeadingproperty to 90 (degrees), and theEnabledproperty to True. You can change these and other properties to modify the balls behavior.The difference between a ball and an image sprite is that the latter can get its appearance from an image, while a balls appearance can only be changed by varying itsPaintColorandRadiusproperties.PropertiesRadiusRadius of the ball.PaintColorColor used for drawing the ball.EnabledIf true, ball is active.IntervalFrequency of balls movement in milliseconds.VisibleIf set, ball is visible.HeadingDirection of the balls travel.XBalls x-coordinate.YBalls y-coordinate.SpeedNumber of pixels ball moves each period.EventsCollidedWith(component other)Called when two animated components (image sprites or balls) have collided. The argumentotherrepresents the other component in the collision.Dragged(number startX, number startY, number prevX, number prevY, number currentX, number currentY)The ball was dragged. See the canvasDraggedevent for a description of the arguments.EdgeReached(number edge)Called when ball reaches the edge of the screen. Theedgeargument tells which edge (or corner) was reached, encoded as follows: north = 1 northeast = 2 east = 3 southeast = 4 south = -1 southwest = -2 west = -3 northwest = -4Note that opposite directions are negations of each other.NoLongerCollidingWith(component other)Called when two animated components have stopped colliding.Touched(number x, number y)Called when user touches the ball.MethodsBounce(number edge)Makes the ball bounce, as if off a wall (or corner). The meaning of the argument is the same as inEdgeReached. You can set up theEdgeReachedevent to make the ball bounce off whichever edge was reached, causing the ball to appear to bounce elastically from all edges and corners.boolean CollidingWith(component other)Reports whether this ball is colliding with the given component.MoveIntoBounds()If the ball is out of bounds, this method moves it back in bounds.MoveTo(number x,number y)Moves the ball directly to the given point.ImageSpriteAn image sprite component is an animated object that can interact with a canvas, balls, and other image sprites.An image sprite is an animated object that is contained by a canvas, can react to touches and drags, interact with other sprites (image sprites and other balls) and the edge of the canvas, and move according to its properties. For example, to have a sprite move 10 pixels to the left every second, you can set theSpeedproperty to 10, theIntervalproperty to 1000 (milliseconds), theHeadingproperty to 180 (degrees), and theEnabledproperty to True. You can change these and other properties to modify the image sprites behavior.PropertiesPicturePicture displayed for the sprite.EnabledIf set, the sprite is active.IntervalFrequency of sprites movement, in milliseconds.PictureThe picture that determines the sprites appearenceRotatesIf true, the sprite image rotates to match the sprites heading.If false, the sprite image does not rotate when the sprite changes heading.VisibleIf set, image sprite is visible.HeadingDirection of the image sprites travel in degrees. Zero is horizontally to the right (east), 90 is straight up, 180 is to the left, and 270 is straight down.XImage sprites x-coordinate. Zero is the left edge of the canvas.YImage sprites y-coordinate. Zero is the top edge of the canvas.SpeedNumber of pixels image sprite moves each period.WidthImage sprite width.HeightImage sprite height.EventsCollidedWith(component other)Called when two animated components (image sprites or balls) have collided. The argumentotherrepresents the other sprite in the collision.Dragged(number startX, number startY, number prevX, number prevY, number currentX, number currentY)The sprite was dragged. See the CanvasDraggedevent for a description of the arguments.EdgeReached(number edge)Called when image sprite reaches the edge of the screen. Theedgeargument tells which edge (or corner) was reached, encoded as follows: north = 1 northeast = 2 east = 3 southeast = 4 south = -1 southwest = -2 west = -3 northwest = -4Note that opposite directions are negations of each other.NoLongerCollidingWith(component other)Called when two animated components have stopped colliding.Touched(number x, number y)Called when user touches the image sprite.MethodsBounce(number edge)Makes the image sprite bounce, as if off a wall (or corner). The meaning of the argument is the same as inEdgeReached. You can set up theEdgeReachedevent to make the sprite bounce off whichever edge was reached, causing the sprite to appear to bounce elastically from all edges and corners.boolean CollidingWith(component other)Reports whether this image sprite is colliding with the given component.MoveIntoBounds()If the image sprite is out of bounds, this method moves it back in bounds.MoveTo(number x,number y)Moves the image sprite directly to the given point.动画元件球ImageSprite球一个球的成分是一种特别雪碧(动画对象),看起来像一个球。一个球是圆的Sprite的,是由帆布中,可以作出反应,触摸和拖动,互动与其他精灵(图像精灵和其他球)和画布边缘,根据其属性和移动。例如,有一个球移动4个像素朝着一个画布的顶部,每500毫秒(半秒),您可以theSpeed财产4,Interval属性为500,标题属性设置为90(度),并启用属性为True。您可以更改这些和其他属性修改球的行为。一个球和一个形象的精灵之间的区别是,后者可以从图像的外观,而一球的外观只能通过不同itsPaintColor和Radius属性的改变。属性半径球的半径。主机颜色使用的颜色绘制的球。启用如果为true,球被激活。区间以毫秒为单位球的运动频率。可见的如果设置,球是可见的。标题球的方向旅行。X球的x坐标。球的y坐标。速度像素数球移动每个时期。活动CollidedWith(其他组件)相撞的两个组成部分(图像精灵球)动画时调用。论点的另一代表在碰撞中的其他组件。拖(数startx时,数量startY,号码prevX,号码prevY,数量的CurrentX,数量currentY)球被拖累。见在画布上拖了一个参数描述的事件。EdgeReached(数量边缘)所谓当球到达屏幕边缘。边缘参数告诉边缘(或角)达成,编码如下:北= 1东北= 2东= 3东南= 4南= -1西南= -2西= -3西北= -4需要注意的是相反的方向是相互否定。NoLongerCollidingWith(其他组件)当两个动画元件碰撞停止调用。感动(数x,数y)所谓当用户触球。方法反弹(数字边缘)使球反弹,仿佛断墙上(或角)。参数的含义是在EdgeReached相同。您可以设置EdgeReached事件使球反弹达到边缘,导致球出现反弹所有棱角弹性。布尔CollidingWith(组件其他)这个球是否是与给定的组件碰撞的报告。MoveIntoBounds()如果球出界,这种方法将其移动回边界之内。MOVETO(数x,数y)移动球直接给定的点。ImageSprite形象雪碧组件是一个动画对象可以与一个画布,球,和其他影像精灵。一个形象的精灵是一个动画的对象,它是一个画布中,可以作出反应,触摸和拖动,互动与其他精灵(图像精灵和其他球)和画布边缘,根据其属性和移动。例如,有一个精灵移动10个像素,左边的每一秒,你可以设定的速度属性,至10日,theInterval财产1000(毫秒),标题属性为180(度),Enabled属性为True。您可以更改这些和其他属性修改的图像精灵的行为。属性图片图片中显示的精灵。启用如果设置,精灵是积极的。区间雪碧的运动频率,以毫秒为单位。图片
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 餐饮项目计划书范文案例(合集37篇)
- 2024-2025年度上海市投资银行业务保荐代表人之保荐代表人胜任能力能力测试试卷A卷附答案
- 松下企业培训课件
- 中班健康教育课
- 教育学讲课课件
- 网络反诈培训
- 学校中层干部培训汇报
- 大学生军训教育实施纲要
- 海水淹溺护理查房
- 酒店疫情培训课件模板
- 水利工程外观质量评定标准DB41-T 1488-2017
- 【高分复习资料】山东大学《244德语》历年考研真题汇编
- 中、小学文件材料分类方案、归档范围、保管期限表(三合一制度)
- 全国行业职业技能竞赛(电力交易员)考试题库及答案
- DB50-T 1293-2022 松材线虫病疫木除治技术规范
- 2024年北京中考地理试卷
- 《市政养护工程施工方案》
- 液化石油气站规章制度2024
- (安全生产)煤矿安全生产监管检查清单
- 无菌技术操作评分标准
- 车库租赁合同
评论
0/150
提交评论