跳到主要内容

eui.Rect

   eui

   public class Rect

继承    eui.Rect → eui.Componentegret.DisplayObjectContaineregret.DisplayObjectegret.EventDispatcheregret.HashObject

Rect 组件矩形绘图元素。此组件可响应鼠标事件。

公共属性

属性
ellipseHeight : number
用于绘制圆角的椭圆的高度 (以像素为单位)
ellipseWidth : number
用于绘制圆角的椭圆的宽度(以像素为单位)
fillAlpha : number
填充透明度,默认值为1
fillColor : number
填充颜色
graphics : egret.Graphics
strokeAlpha : number
边框透明度,注意:当 strokeWeight 为0时,不显示边框
strokeColor : number
边框颜色,注意:当 strokeWeight 为 0 时,不显示边框
strokeWeight : number
边框粗细(像素),注意:当 strokeWeight 为 0 时,不显示边框

公共方法

方法
Rect(width:number,height:number,fillColor:number)

事件

Events
egret.Event.COMPLETE
当设置skinName为外部exml文件路径时,加载并完成EXML解析后调度。
egret.Event.RESIZE
当UI组件的尺寸发生改变时调度
eui.UIEvent.MOVE
当UI组件在父级容器中的位置发生改变时调度
eui.UIEvent.CREATION_COMPLETE
当UI组件第一次被添加到舞台并完成初始化后调度
egret.Event.ADDED
将显示对象添加到显示列表中时调度。
egret.Event.ADDED_TO_STAGE
在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。
egret.Event.REMOVED
将要从显示列表中删除显示对象时调度。
egret.Event.REMOVED_FROM_STAGE
在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。
egret.Event.ENTER_FRAME
[广播事件] 播放头进入新帧时调度。
egret.Event.RENDER
[广播事件] 将要更新和呈现显示列表时调度。
egret.TouchEvent.TOUCH_MOVE
当用户触碰设备时进行调度,而且会连续调度,直到接触点被删除。
egret.TouchEvent.TOUCH_BEGIN
当用户第一次触摸启用触摸的设备时(例如,用手指触摸手机屏幕)调度。
egret.TouchEvent.TOUCH_END
当用户移除与启用触摸的设备的接触时(例如,将手指从屏幕上抬起)调度。
egret.TouchEvent.TOUCH_TAP
当用户在启用触摸设备上的已启动接触的同一 DisplayObject 实例上抬起接触点时(例如,手机点击屏幕后抬起)调度。
egret.TouchEvent.TOUCH_RELEASE_OUTSIDE
当用户在启用触摸设备上的已启动接触的不同 DisplayObject 实例上抬起接触点时(例如,按住屏幕上的某个对象,然后从它上面挪开后再松开手指)调度。

属性详细信息

ellipseHeight

ellipseHeight : number

  • 支持版本:eui 1.0
  • 运行平台:Web,Native

用于绘制圆角的椭圆的高度 (以像素为单位)。如果未指定值,则默认值与为 ellipseWidth 参数提供的值相匹配。

ellipseWidth

ellipseWidth : number

  • 支持版本:eui 1.0
  • 运行平台:Web,Native

用于绘制圆角的椭圆的宽度(以像素为单位)

fillAlpha

fillAlpha : number

  • 支持版本:eui 1.0
  • 运行平台:Web,Native

填充透明度,默认值为1。

fillColor

fillColor : number

  • 支持版本:eui 1.0
  • 运行平台:Web,Native

填充颜色

graphics

graphics : egret.Graphics

  • 支持版本:all
  • 运行平台:Web,Native

strokeAlpha

strokeAlpha : number

  • 支持版本:eui 1.0
  • 运行平台:Web,Native

边框透明度,注意:当 strokeWeight 为0时,不显示边框。

strokeColor

strokeColor : number

  • 支持版本:eui 1.0
  • 运行平台:Web,Native

边框颜色,注意:当 strokeWeight 为 0 时,不显示边框。

strokeWeight

strokeWeight : number

  • 支持版本:eui 1.0
  • 运行平台:Web,Native

边框粗细(像素),注意:当 strokeWeight 为 0 时,不显示边框。

方法详细信息

Rect()

public Rect(width:number,height:number,fillColor:number)