Documentation ¶
Overview ¶
Package ani 动画特效.
Index ¶
- type Anima
- func (a *Anima) Alpha(duration int, alpha uint8, nLoopCount int, ease_flag xcc.Ease_Flag_, ...) *AnimaItem
- func (a *Anima) AlphaEx(duration int, from_alpha uint8, to_alpha uint8, nLoopCount int, ...) *AnimaItem
- func (a *Anima) Color(duration int, color int, nLoopCount int, ease_flag xcc.Ease_Flag_, ...) *AnimaItem
- func (a *Anima) ColorEx(duration int, from int, to int, nLoopCount int, ease_flag xcc.Ease_Flag_, ...) *AnimaItem
- func (a *Anima) Delay(duration float32) *AnimaItem
- func (a *Anima) DelayEx(duration float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int
- func (a *Anima) DestroyObjectUI(duration float32) *AnimaItem
- func (a *Anima) EnableAutoDestroy(bEnable bool) int
- func (a *Anima) GetObjectUI() int
- func (a *Anima) GetUserData() int
- func (a *Anima) LayoutHeight(duration int, nType xcc.Layout_Size_, height float32, nLoopCount int, ...) *AnimaItem
- func (a *Anima) LayoutSize(duration int, nWidthType xcc.Layout_Size_, width float32, ...) *AnimaItem
- func (a *Anima) LayoutWidth(duration int, nType xcc.Layout_Size_, width float32, nLoopCount int, ...) *AnimaItem
- func (a *Anima) Move(duration int, x float32, y float32, nLoopCount int, ease_flag xcc.Ease_Flag_, ...) *AnimaItem
- func (a *Anima) MoveEx(duration int, from_x float32, from_y float32, to_x float32, to_y float32, ...) *AnimaItem
- func (a *Anima) Pause() bool
- func (a *Anima) Release(bEnd bool) bool
- func (a *Anima) ReleaseEx(bEnd bool) int
- func (a *Anima) Rotate(duration int, angle float32, nLoopCount int, ease_flag xcc.Ease_Flag_, ...) *AnimaRotate
- func (a *Anima) RotateEx(duration int, from float32, to float32, nLoopCount int, ...) *AnimaRotate
- func (a *Anima) Run(hRedrawObjectUI int) int
- func (a *Anima) Scale(duration int, scaleX float32, scaleY float32, nLoopCount int, ...) *AnimaScale
- func (a *Anima) ScaleSize(duration int, width float32, height float32, nLoopCount int, ...) *AnimaScale
- func (a *Anima) SetCallBack(callback interface{}) int
- func (a *Anima) SetUserData(nUserData int) int
- func (a *Anima) Show(duration float32, bShow bool) *AnimaItem
- func (a *Anima) Start() bool
- func (a *Anima) Stop() bool
- type AnimaGroup
- func (a *AnimaGroup) AddItem(hSequence int) int
- func (a *AnimaGroup) EnableAutoDestroy(bEnable bool) int
- func (a *AnimaGroup) GetObjectUI() int
- func (a *AnimaGroup) GetUserData() int
- func (a *AnimaGroup) Pause() bool
- func (a *AnimaGroup) Release(bEnd bool) bool
- func (a *AnimaGroup) ReleaseEx(bEnd bool) int
- func (a *AnimaGroup) Run(hRedrawObjectUI int) int
- func (a *AnimaGroup) SetCallBack(callback interface{}) int
- func (a *AnimaGroup) SetUserData(nUserData int) int
- func (a *AnimaGroup) Start() bool
- func (a *AnimaGroup) Stop() bool
- type AnimaItem
- type AnimaRotate
- type AnimaScale
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anima ¶
type Anima struct {
// contains filtered or unexported fields
}
动画序列.
func NewAnima ¶
动画_创建动画序列, 按顺序执行的动画列表, 返回动画序列对象.
hObjectUI: 绑定的UI对象. UI对象句柄: 窗口句柄, 元素句柄, 形状句柄, SVG句柄.
nLoopCount: 动画循环次数, 0: 无限循环.
func (*Anima) Alpha ¶
func (a *Anima) Alpha(duration int, alpha uint8, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem
动画_透明度, 返回动画项对象.
duration: 持续时间.
alpha: 透明度.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) AlphaEx ¶
func (a *Anima) AlphaEx(duration int, from_alpha uint8, to_alpha uint8, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem
动画_透明度扩展, 从指定透明度到目标透明度, 返回动画项对象.
duration: 持续时间.
from_alpha: 起始透明度.
to_alpha: 终止透明度.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) Color ¶
func (a *Anima) Color(duration int, color int, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem
动画_颜色, 返回动画项对象.
duration: 持续时间.
color: ABGR颜色.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) ColorEx ¶
func (a *Anima) ColorEx(duration int, from int, to int, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem
动画_颜色扩展, 从指定颜色到目标颜色, 返回动画项对象.
duration: 持续时间.
from: 起点颜色, ABGR颜色.
to: 终点颜色, ABGR颜色.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) DelayEx ¶
func (a *Anima) DelayEx(duration float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) int
动画_延迟扩展, 可以作为一个空动画, 然后在回调里处理自己的算法, 返回动画项句柄.
duration: 持续时间.
nLoopCount: 动画循环次数, 0:无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) LayoutHeight ¶
func (a *Anima) LayoutHeight(duration int, nType xcc.Layout_Size_, height float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem
动画_布局高度, 修改布局高度属性, 返回动画项对象.
duration: 持续时间.
nType: 布局高度类型: xcc.Layout_Size_.
height: 布局高度.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) LayoutSize ¶
func (a *Anima) LayoutSize(duration int, nWidthType xcc.Layout_Size_, width float32, nHeightType xcc.Layout_Size_, height float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem
动画_布局大小, 修改布局宽度和高度, 返回动画项对象.
duration: 持续时间.
nWidthType: 布局宽度类型: xcc.Layout_Size_.
width: 布局宽度.
nHeightType: 布局高度类型: xcc.Layout_Size_.
height: 布局高度.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) LayoutWidth ¶
func (a *Anima) LayoutWidth(duration int, nType xcc.Layout_Size_, width float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem
动画_布局宽度, 修改布局宽度属性, 返回动画项对象.
duration: 持续时间.
nType: 布局宽度类型: xcc.Layout_Size_.
width: 布局宽度.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) Move ¶
func (a *Anima) Move(duration int, x float32, y float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem
动画_移动, 移动到目标位置, 默认以UI对象中心点为操作方式, 避免出现坐标错位, 返回动画项对象.
duration: 持续时间.
x: 终点位置X(对象左上角坐标).
y: 终点位置Y(对象左上角坐标).
nLoopCount: 动画循环次数, 0:无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) MoveEx ¶
func (a *Anima) MoveEx(duration int, from_x float32, from_y float32, to_x float32, to_y float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaItem
动画_移动扩展, 从指定位置移动到目标位置, 默认以UI对象中心点为操作方式, 避免出现坐标错位, 返回动画项对象.
duration: 持续时间.
from_x: 起点位置X(对象左上角坐标).
from_y: 起点位置Y(对象左上角坐标).
to_x: 终点位置X(对象左上角坐标).
to_y: 终点位置Y(对象左上角坐标).
nLoopCount: 动画循环次数, 0:无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) Rotate ¶
func (a *Anima) Rotate(duration int, angle float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaRotate
动画_旋转, 旋转角度支持负数值, 因为负数可以控制反向旋转, 返回动画旋转项对象.
duration: 持续时间.
angle: 角度.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) RotateEx ¶
func (a *Anima) RotateEx(duration int, from float32, to float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaRotate
动画_旋转扩展, 指定起点和终点, 返回动画旋转项对象.
duration: 持续时间.
from: 起点角度.
to: 终点角度.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) Run ¶
动画_运行, 并且增加引用计数.
hRedrawObjectUI: 当更新UI时重绘的UI层. UI对象句柄: 窗口句柄, 元素句柄, 形状句柄, SVG句柄.
func (*Anima) Scale ¶
func (a *Anima) Scale(duration int, scaleX float32, scaleY float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaScale
动画_缩放, 缩放对象, 默认以自身为中心缩放, 返回动画缩放项对象.
duration: 持续时间.
scaleX: X轴缩放比例.
scaleY: Y轴缩放比例.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) ScaleSize ¶
func (a *Anima) ScaleSize(duration int, width float32, height float32, nLoopCount int, ease_flag xcc.Ease_Flag_, bGoBack bool) *AnimaScale
动画_缩放大小, 修改UI对象大小, 默认向右延伸, 返回动画缩放项对象.
duration: 持续时间.
width: 宽度.
height: 高度.
nLoopCount: 动画循环次数, 0: 无限循环.
ease_flag: 缓动标识, Ease_Flag_.
bGoBack: 是否返回. 当启用后: 往返到起点, 起点->终点->起点.
func (*Anima) SetCallBack ¶
func (a *Anima) SetCallBack(callback interface{}) int
动画_置回调.
callback: 回调函数.
type AnimaGroup ¶
type AnimaGroup struct {
// contains filtered or unexported fields
}
动画组.
func NewAnimaGroup ¶
func NewAnimaGroup(nLoopCount int) *AnimaGroup
动画组_创建, 动画同步组, 当组中动画序列全部完成后, 重新开始.
当遇到无限循环项时, 直至其他序列完成后终止循环, 避免出现无法到达终点, 无法返回头部进行同步, 返回动画组句柄.
nLoopCount: 动画循环次数, 0: 无限循环.
func (*AnimaGroup) AddItem ¶
func (a *AnimaGroup) AddItem(hSequence int) int
动画组_添加项, 将动画序列添加到组中.
hSequence: 动画序列句柄.
func (*AnimaGroup) GetObjectUI ¶
func (a *AnimaGroup) GetObjectUI() int
动画_取UI对象, 获取动画关联的UI对象, 返回UI对象句柄.
func (*AnimaGroup) Run ¶
动画_运行, 并且增加引用计数.
hRedrawObjectUI: 当更新UI时重绘的UI层. UI对象句柄: 窗口句柄, 元素句柄, 形状句柄, SVG句柄.
func (*AnimaGroup) SetCallBack ¶
func (a *AnimaGroup) SetCallBack(callback interface{}) int
动画_置回调.
callback: 回调函数.
type AnimaItem ¶
type AnimaItem struct {
objectbase.ObjectBase
}
动画项.
func (*AnimaItem) EnableCompleteRelease ¶
动画项_启用完成释放, 当动画项完成后自动释放.
例如对多个动画序列进行渐近式延迟, 在动画序列头标添加延时项(时间差), 当延时项完成时自动释放, 后续动画循环就形成一种时间差(因为对齐的时间差销毁了, 他们永远无法对齐时间).
bEnable: 是否启用.
type AnimaScale ¶
type AnimaScale struct {
objectbase.ObjectBase
}
动画缩放项.
func (*AnimaScale) SetPosition ¶
func (a *AnimaScale) SetPosition(position xcc.Position_Flag_) bool
动画缩放_置延伸位置, 设置缩放起点, 确定延伸方向.
position: 位置, Position_Flag_.