Commit 7730c34f authored by rockyl's avatar rockyl

scilla新模式开始

parents
Pipeline #140314 failed with stages
in 0 seconds
# Created by .ignore support plugin (hsz.mobi)
/dist/
/node_modules/
\ No newline at end of file
1. 常量补全,不要出现魔法字符串
2. 成员变量的默认值直接在声明时赋值即可,不需要在构造方法里赋值,不然编辑器无法识别默认值
3. 不需要暴露出来的成员变量加上'$'或者'_'前缀,能被编辑器过滤掉
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="true" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
<meta name="360-fullscreen" content="true" />
<!-- <meta name="viewport" content="width=device-width,minimum-scale=1.0,user-scalable=no"> -->
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: white;
}
/* .top {
width: 100%;
height: 100px;
} */
</style>
</head>
<body>
<!-- <div id="testCanvas" style="background-color: #000000; width: 500px; height: 500px; margin: auto"></div> -->
<!-- <img src="" id="img" /> -->
<div id="cusEngine" style="line-height:0;font-size:0"></div>
<!-- <canvas id='my-canvas' width='480' height='400'>
对不起,您的浏览器未支持H5内容.
</canvas> -->
<!-- <script>
console.log(window["p2"])
</script> -->
<!-- 只是视图,全局量为p2,用于测试,pixi估计很久的版本 -->
<!-- <script type="text/javascript" src="./p2.renderer.js"></script>
<script type="text/javascript" src="./index.js"></script> -->
<script type="text/javascript" src="dist/bundle.js"></script>
</body>
<script>
var cusMaxScore = 0;
function cusInitShareFunc(t) {
wx.ready(function () {
wx.onMenuShareTimeline({
title: "我在南塘河赛龙舟得了" + t + "分,快来比一比谁是赛龙舟高手。",
link: window.shareLink,
imgUrl: window.shareImgUrl,
success: function (t) {
}
});
wx.onMenuShareAppMessage({
title: "我在南塘河赛龙舟得了" + t + "分,快来比一比谁是赛龙舟高手。",
desc: "撞蛋、薄饼、粽子,体验不一样的赛龙舟!",
link: window.shareLink,
imgUrl: window.shareImgUrl,
success: function (t) {
}
})
});
};
</script>
</html>
\ No newline at end of file
{
"name": "scilla-engine",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-typescript": "^1.0.1",
"rollup-plugin-uglify": "^6.0.2",
"tslib": "^1.10.0",
"typescript": "^3.5.3"
}
}
/**
* Created by rockyl on 2018/11/16.
*/
const resolve = require('rollup-plugin-node-resolve');
const typescript = require('rollup-plugin-typescript');
const {uglify} = require('rollup-plugin-uglify');
const name = 'Main';
export default {
input: 'src/Main.ts',
output: [
{
file: `dist/bundle.js`,
format: 'umd',
name,
sourcemap: true,
}
],
plugins: [
resolve({
browser: true,
}),
typescript({
typescript: require('typescript'),
tslib: require('tslib'),
declaration: false,
}),
//uglify(),
]
};
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
/**
* 考虑是否需要
*/
export abstract class HashObject {
protected _instanceId: number = 0;
protected _instanceType: string = "HashObject";
protected static _object_id = 0;
constructor() {
this._instanceId = HashObject._object_id++;
}
/**
* 每一个对象都会有一个唯一的id码。
* @property instanceId
* @public
* @since 1.0.0
* @return {number}
* @readonly
* @example
* //获取 对象唯一码
* trace(this.instanceId);
*/
public get instanceId(): number {
return this._instanceId;
}
/**
* 每一个类都有一个实例类型字符串,通过这个字符串,你能知道这个实例是从哪个类实例而来
* @property instanceType
* @since 1.0.3
* @public
* @return {string}
* @readonly
*/
public get instanceType(): string {
return this._instanceType;
}
/**
* 销毁一个对象
* 销毁之前一定要从显示对象移除,否则将会出错
* @method destroy
* @since 2.0.0
* @public
* @return {void}
*/
abstract destroy(): void;
}
/**
* Created by rockyl on 2018/11/5.
*/
import {HashObject} from "../HashObject";
import {DisplayObject} from "../display/DisplayObject";
// import {EngineConfig} from "../engine-config";
const interactiveMap = [
'_dealGlobalTouchBegin',
'_dealGlobalTouchMove',
'_dealGlobalTouchEnd',
];
/**
* 组件基类
*/
export class Component extends HashObject {
/**
* 所依附的实体
*/
entity: DisplayObject;
protected delayCallbacks = [];
//是否有效
protected _enabled: boolean /*= EngineConfig.componentEnabled;*/
private _firstUpdate: boolean /*= EngineConfig.componentEnabled;*/
constructor(){
super();
this._instanceType="Component";
this.onCreate();
}
/**
* 是否有效状态
*/
get enabled(): boolean {
return this._enabled;
}
set enabled(value: boolean) {
if (this._enabled !== value) {
this._enabled = value;
// if (this.entity && this.entity.isActive) {
// if (!EngineConfig.editorMode) {
// if (this._enabled) {
// this.onEnable();
// } else {
// this.onDisable();
// }
// }
// }
}
}
/**
* 装配实体
* @param entity
*/
_setup(entity: DisplayObject) {
this.entity = entity;
}
/**
* 卸载实体
*/
_unSetup() {
this.entity = null;
}
/**
* 当组件被创建时
*/
onCreate() {
}
$onAwake() {
// if (!EngineConfig.editorMode) {
// this.onAwake();
// }
}
/**
* 当组件被唤醒时
*/
onAwake() {
}
/**
* 当组件生效时
*/
onEnable() {
}
/**
* 当组件失效时
*/
onDisable() {
}
$onUpdate(t) {
this.onUpdate(t);
if (!this._firstUpdate) {
this.invokeDelayCallback(t);
}
this._firstUpdate = false;
}
$onEditorUpdate(t) {
this.onEditorUpdate(t);
}
$afterUpdate() {
this.afterUpdate();
}
$afterEditorUpdate() {
this.afterEditorUpdate();
}
private invokeDelayCallback(t) {
for (let i = 0, li = this.delayCallbacks.length; i < li; i++) {
let {callback, once} = this.delayCallbacks[i];
if (once) {
this.delayCallbacks.splice(i, 1);
i--;
li--;
}
callback.call(this, t);
}
}
/**
* 当时钟更新时
* @param t 从引擎开始到当前的毫秒数
*/
onUpdate(t) {
}
onEditorUpdate(t) {
}
/**
* 当子实体的时钟更新结束后
*/
afterUpdate() {
}
afterEditorUpdate() {
}
$onSleep() {
// if (!EngineConfig.editorMode) {
// this.onSleep();
// }
}
/**
* 当组件沉睡时
*/
onSleep() {
}
/**
* 当组件被销毁时
*/
onDestroy() {
}
/**
* 当被监听的属性被修改时
* @param value
* @param key
* @param oldValue
*/
protected onModify(value, key, oldValue) {
}
private getDelayCallback(callback) {
let result;
for (let item of this.delayCallbacks) {
if (item.callback == callback) {
result = item;
break;
}
}
return result;
}
/**
* 执行延迟回调
* @param callback
* @param once 是否只执行一次
*/
callOnNextTick(callback, once = true) {
const item = this.getDelayCallback(callback);
if (!item) {
this.delayCallbacks.push({callback, once});
}
}
cancelOnNextTick(callback) {
const item = this.getDelayCallback(callback);
const index = this.delayCallbacks.indexOf(item);
if (index >= 0) {
this.delayCallbacks.splice(index, 1);
}
}
/**
* 当交互时
* @param type
* @param event
*/
onInteract(type, event) {
try {
const hitOn = this[interactiveMap[type]](event);
return hitOn;
} catch (e) {
console.warn(e);
}
}
_dealGlobalTouchBegin(e) {
return this.onGlobalTouchBegin(e);
}
_dealGlobalTouchMove(e) {
return this.onGlobalTouchMove(e);
}
_dealGlobalTouchEnd(e) {
return this.onGlobalTouchEnd(e);
}
/**
* 当全局触摸开始
* @param e
*/
onGlobalTouchBegin(e) {
return false;
}
/**
* 当全触摸移动
* @param e
*/
onGlobalTouchMove(e) {
return false;
}
/**
* 当全触摸结束
* @param e
*/
onGlobalTouchEnd(e) {
return false;
}
destroy(){
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import { Event } from "../events/Event";
import { DisplayObject } from "./DisplayObject";
import { devicePixelRatio } from "../const";
/**
* 此类对于需要在canvas上放置html其他类型元素的时候非常有用<br/>
* 比如有时候我们需要放置一个注册,登录或者其他的内容.这些内容包含了输入框<br/>
* 或者下拉框什么的,无法在canvas里实现,但这些元素又跟canvas里面的元素<br/>
* 位置,大小,缩放对应.就相当于是一个显示对象一样。可以随意设置他的<br/>
* 属性,那么将你的html元素通过此类封装成显示对象再合适不过了
* @class FloatDisplay
* @extends DisplayObject
* @public
* @since 1.0.0
*/
export class FloatDisplay extends DisplayObject {
/**
* 需要封装起来的html元素的引用。你可以通过这个引用来调用或设置此元素自身的属性方法和事件,甚至是样式
* @property htmlElement
* @public
* @since 1.0.0
* @type{HtmlElement}
*/
public htmlElement: any = null;
/**
* 是否已经添加了舞台事件
* @property _isAdded
* @since 1.0.0
* @type {boolean}
* @private
*/
private _isAdded: boolean = false;
_transformID: number;
/**
* 构造函数
* @method FloatDisplay
* @since 1.0.0
* @public
* @example
* var floatDisplay = new FloatDisplay();
* floatDisplay.init(document.getElementById('aaa'));
* s.addChild(floatDisplay);
*
* <p><a href="" target="_blank">测试链接</a></p>
*
* @example
* //创建悬浮的html元素
* var section = document.createElement('section');
* section.id = "rule";
* section.style.overflowX = "hidden";
* section.style.overflowY = "auto";
* section.style.width = w + "px";
* section.style.height = h + "px";
* section.style.lineHeight = lh + "px";
* section.style.fontFamily = '微软雅黑';
* section.style.fontSize = fs + 'px';
* section.style.color = "#ffffff";
* //创建Floatview 把我们要悬浮的元素封装进去
* var rule = new FloatDisplay();
* stage.addChild(rule);
* rule.x = ox;
* rule.y = oy;
* rule.init(this.section);
* section.innerHTML = DataManager.ins.getData("ajaxElement").data.rule;
*
*/
public constructor() {
super();
let s = this;
s._instanceType = "FloatDisplay";
s.addEventListener(Event.REMOVE_TO_STAGE, function (e: Event) {
if (s.htmlElement) {
s.htmlElement.style.display = "none";
}
});
s.addEventListener(Event.ADD_TO_STAGE, function (e: Event) {
if (s.htmlElement) {
let style = s.htmlElement.style;
if (!s._isAdded) {
s._isAdded = true;
s.stage.rootDiv.insertBefore(s.htmlElement, s.stage.rootDiv.childNodes[0]);
s.stage["_floatDisplayList"].push(s);
} else {
if (s.htmlElement && s.visible) {
style.display = "block";
}
}
}
});
this._transformID = -1;
}
/**
* 初始化方法,htmlElement 一定要设置width和height样式,并且一定要用px单位
* @method init
* @public
* @since 1.0.0
* @param {HtmlElement} htmlElement 需要封装起来的html元素的引用。你可以通过这个引用来调用或设置此元素自身的属性方法和事件,甚至是样式
*/
public init(htmlElement: any): void {
let s = this;
let she: any;
if (typeof (htmlElement) == "string") {
she = document.getElementById(htmlElement);
} else if (htmlElement._instanceType == "Video") {
she = htmlElement.media;
} else {
she = htmlElement;
}
let style = she.style;
style.position = "absolute";
style.display = "none";
style.transformOrigin = style.WebkitTransformOrigin = "0 0 0";
let ws = s.getStyle(she, "width");
let hs = s.getStyle(she, "height");
let w = 0, h = 0;
if (ws.indexOf("px")) {
w = parseInt(ws);
}
if (hs.indexOf("px")) {
h = parseInt(hs);
}
s._bounds.width = w;
s._bounds.height = h;
s.htmlElement = she;
}
/**
* @method getStyle
* @param {HTMLElement} elem
* @param cssName
* @return {any}
*/
private getStyle(elem: HTMLElement, cssName: any): any {
//如果该属性存在于style[]中,则它最近被设置过(且就是当前的)
if (elem.style[cssName]) {
return elem.style[cssName];
}
if (document.defaultView && document.defaultView.getComputedStyle) {
//它使用传统的"text-Align"风格的规则书写方式,而不是"textAlign"
cssName = cssName.replace(/([A-Z])/g, "-$1");
cssName = cssName.toLowerCase();
//获取style对象并取得属性的值(如果存在的话)
let s = document.defaultView.getComputedStyle(elem, "");
return s && s.getPropertyValue(cssName);
}
return null;
}
/**
* @method updateStyle
* @public
* @since 1.1.4
*/
public updateStyle(): void {
let s = this;
let o = s.htmlElement;
if (o) {
let style = o.style;
let visible = s.visible;
if (visible) {
let parent = s.parent;
while (parent) {
if (!parent._visible) {
visible = false;
break;
}
parent = parent.parent;
}
}
let show = visible ? "block" : "none";
if (show != style.display) {
style.display = show;
}
if (visible) {
if (this._transformID != this.transform._worldID) {
this._transformID = this.transform._worldID
let mtx = s.transform.worldMatrix;
let d = devicePixelRatio;
style.transform = style.webkitTransform = "matrix(" + (mtx.a / d).toFixed(4) + "," + (mtx.b / d).toFixed(4) + "," + (mtx.c / d).toFixed(4) + "," + (mtx.d / d).toFixed(4) + "," + (mtx.tx / d).toFixed(4) + "," + (mtx.ty / d).toFixed(4) + ")";
}
style.opacity = s.worldAlpha;
}
}
}
public destroy(): void {
//清除相应的数据引用
let s = this;
let elem = s.htmlElement;
if (elem) {
elem.style.display = "none";
if (elem.parentNode) {
elem.parentNode.removeChild(elem);
}
s._isAdded = false;
s.htmlElement = null;
}
let sf: any = s.stage["_floatDisplayList"];
let len = sf.length;
for (let i = 0; i < len; i++) {
if (sf[i] == s) {
sf.splice(i, 1);
break;
}
}
super.destroy();
}
}
This diff is collapsed.
This diff is collapsed.
import { HashObject } from "../HashObject";
/**
* 事件类,引擎中一切事件的基类
* @class Event
* @extends AObject
* @public
* @since 1.0.0
*/
export class Event extends HashObject {
// public static IMAGE_LOADED: string = "onImageLoaded"
public static INIT_TO_STAGE: string = "onInitStage";
/**
* 舞台尺寸发生变化时触发
* @Event
* @property RESIZE
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static RESIZE: string = "onResize";
/**
* 引擎暂停或者恢复暂停时触发,这个事件只能在globalDispatcher 中监听
* @Event
* @property ON_RUN_CHANGED
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static ON_RUN_CHANGED: string = "onRunChanged";
/**
* Media相关媒体类的播放刷新事件。像Sound Video都可以捕捉这种事件。
* @property ON_PLAY_UPDATE
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_PLAY_UPDATE = "onPlayUpdate";
/**
* Media相关媒体类的播放完成事件。像Sound Video都可以捕捉这种事件。
* @property ON_PLAY_END
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_PLAY_END = "onPlayEnd";
/**
* Media相关媒体类的开始播放事件。像Sound Video都可以捕捉这种事件。
* @property ON_PLAY_START
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_PLAY_START = "onPlayStart";
/**
* FlipBook组件翻页开始事件
* @property ON_FLIP_START
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_FLIP_START = "onFlipStart";
/**
* FlipBook组件翻页结束事件
* @property ON_FLIP_STOP
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_FLIP_STOP = "onFlipStop";
/**
* ScrollPage组件滑动到开始位置事件
* @property ON_SCROLL_TO_HEAD
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_SCROLL_TO_HEAD = "onScrollToHead";
/**
* ScrollPage组件停止滑动事件
* @property ON_SCROLL_STOP
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_SCROLL_STOP = "onScrollStop";
/**
* ScrollPage组件开始滑动事件
* @property ON_SCROLL_START
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_SCROLL_START = "onScrollStart";
/**
* ScrollPage组件滑动到结束位置事件
* @property ON_SCROLL_TO_END
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_SCROLL_TO_END = "onScrollToEnd";
/**
* Slide 组件开始滑动事件
* @property ON_SLIDE_START
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_SLIDE_START = "onSlideStart";
/**
* Slide 组件结束滑动事件
* @property ON_SLIDE_END
* @static
* @since 1.1.0
* @type {string}
*/
public static ON_SLIDE_END = "onSlideEnd";
/**
* 舞台初始化完成后会触发的事件
* @property ON_INIT_STAGE
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static ON_INIT_STAGE: string = "onInitStage";
/**
* 显示对象加入到舞台事件
* @Event
* @property ADD_TO_STAGE
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static ADD_TO_STAGE: string = "onAddToStage";
/**
* 显示对象从舞台移出事件
* @Event
* @property REMOVE_TO_STAGE
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static REMOVE_TO_STAGE: string = "onRemoveToStage";
/**
* 显示对象 循环帧事件
* @Event
* @property ENTER_FRAME
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static ENTER_FRAME: string = "onEnterFrame";
/**
* MovieClip 播放完成事件
* @Event
* @property END_FRAME
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static END_FRAME: string = "onEndFrame";
/**
* MovieClip 帧标签事件
* @Event
* @property CALL_FRAME
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static CALL_FRAME: string = "onCallFrame";
/**
* 完成事件
* @Event
* @property COMPLETE
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static COMPLETE: string = "onComplete";
/**
* 加载过程事件
* @Event
* @property PROGRESS
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static PROGRESS: string = "onProgress";
/**
* 出错事件
* @Event
* @property ERROR
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static ERROR: string = "onError";
/**
* 中断事件
* @Event
* @property ABORT
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static ABORT: string = "onAbort";
/**
* 开始事件
* @Event
* @property START
* @type {string}
* @static
* @public
* @since 1.0.0
*/
public static START: string = "onStart";
/**
* 定时器触发事件
* @property TIMER
* @static
* @since 1.0.9
* @public
* @type {string}
*/
public static TIMER: string = "onTimer";
/**
* 定时器完成事件
* @property TIMER_COMPLETE
* @since 1.0.9
* @static
* @public
* @type {string}
*/
public static TIMER_COMPLETE: string = "onTimerComplete";
/**
* 事件类型名
* @property type
* @type {string}
* @public
* @since 1.0.0
*/
public type: string = "";
/**
* 触发此事件的对象
* @property target
* @public
* @since 1.0.0
* @type {any}
*/
public target: any = null;
/**
* 随着事件一起附带的信息对象
* 所有需要随事件一起发送的信息都可以放在此对象中
* @property data
* @public
* @since 1.0.0
* @type {any}
* @default null
*/
public data: any = null;
/**
* @method Event
* @param {string} type 事件类型
* @public
* @since 1.0.0
*/
public constructor(type: string) {
super();
this._instanceType = "Event";
this.type = type;
}
/**
* 防止对事件流中当前节点中和所有后续节点中的事件侦听器进行处理。
* @method stopImmediatePropagation
* @public
* @return {void}
* @since 2.0.0
*/
public stopImmediatePropagation(): void {
this._pd = true;
}
/**
* 防止对事件流中当前节点的后续节点中的所有事件侦听器进行处理。
* @method stopPropagation
* @public
* @since 2.0.0
* @return {void}
*/
public stopPropagation(): void {
this._bpd = true;
}
private _bpd: boolean = false;
/**
* 是否阻止事件向下冒泡
* @property _pd
* @type {boolean}
* @private
* @since 1.0.0
*/
private _pd: boolean = false;
public destroy(): void {
let s = this;
s.target = null;
s.data = null;
}
/**
* 重围事件到初始状态方便重复利用
* @method reset
* @param {string} type
* @param target
* @since 2.0.0
* @return {void}
* @public
*/
public reset(type: string, target: any): void {
let s = this;
s.target = target;
s._pd = false;
s._bpd = false;
s.type = type;
}
}
This diff is collapsed.
export class GDispatcher {
/**
* 事件回调池
*/
private static callbackPool: any = {};
/**
* 事件作用域池
*/
private static thisObjPool: any = {};
/**
*
* @param name 事件名
* @param callback 回调
* @param thisObj 作用域
*/
public static addEvent(name: string, callback, thisObj: any): void {
if (!this.callbackPool[name]) {
this.callbackPool[name] = [];
this.thisObjPool[name] = [];
}
const index: number = this.callbackPool[name].indexOf(callback);
if (index != -1) {
this.callbackPool[name][index] = callback;
this.thisObjPool[name][index] = thisObj;
} else {
this.callbackPool[name].push(callback);
this.thisObjPool[name].push(thisObj);
}
}
/**
*
* @param name 事件名
* @param callback 回调
* @param thisObj 作用域
*/
public static removeEvent(name: string, callback, thisObj?: any): void {
if (this.callbackPool[name]) {
const index: number = this.callbackPool[name].indexOf(callback);
if (index != -1) {
this.callbackPool[name].splice(index, 1);
this.thisObjPool[name].splice(index, 1);
}
}
}
/**
* 派发事件
* @param name 事件名
* @param args 任意参数
*/
public static dispatchEvent(name: string, ...args): void {
const callbacks: Function[] = this.callbackPool[name];
const thisObjs: any = this.thisObjPool[name];
if (callbacks) {
let i = 0;
const len: number = callbacks.length;
for (i; i < len; i++) {
callbacks[i].apply(thisObjs[i], args);
}
}
}
}
\ No newline at end of file
import { Event } from "./Event";
import { DisplayObject } from "../display/DisplayObject";
/**
* 鼠标事件类,电脑端鼠标,移动设备端的触摸都使用此事件来监听
* @class MouseEvent
* @extends Event
* @public
* @since 1.0.0
*/
export class MouseEvent extends Event {
/**
* 鼠标或者手指按下事件
* @property MOUSE_DOWN
* @static
* @public
* @since 1.0.0
* @type {string}
*/
public static MOUSE_DOWN: string = "onMouseDown";
/**
* 鼠标或者手指抬起事件
* @property MOUSE_UP
* @static
* @public
* @since 1.0.0
* @type {string}
*/
public static MOUSE_UP: string = "onMouseUp";
/**
* 鼠标或者手指单击
* @property CLICK
* @static
* @public
* @since 1.0.0
* @type {string}
*/
public static CLICK: string = "onMouseClick";
/**
* 鼠标或者手指移动事件
* @property MOUSE_MOVE
* @static
* @public
* @since 1.0.0
* @type {string}
*/
public static MOUSE_MOVE: string = "onMouseMove";
/**
* 鼠标或者手指移入到显示对象上里触发的事件
* @property MOUSE_OVER
* @static
* @public
* @since 1.0.0
* @type {string}
*/
public static MOUSE_OVER: string = "onMouseOver";
/**
* 鼠标或者手指移出显示对象边界触发的事件
* @property MOUSE_OUT
* @static
* @public
* @since 1.0.0
* @type {string}
*/
public static MOUSE_OUT: string = "onMouseOut";
/**
* mouse或touch事件时rootDiv坐标x点
* @property clientX
* @public
* @since 1.0.0
* @type {number}
*/
public clientX: number = 0;
/**
* mouse或touch事件时rootDiv坐标y点
* @property clientY
* @public
* @since 1.0.0
* @type {number}
*/
public clientY: number = 0;
/**
* mouse或touch事件时全局坐标x点
* @property stageX
* @public
* @since 1.0.0
* @type {number}
*/
public stageX: number = 0;
/**
* mouse或touch事件时全局坐标y点
* @property stageY
* @public
* @since 1.0.0
* @type {number}
*/
public stageY: number = 0;
/**
* mouse或touch事件时本地坐标x点
* @property localX
* @public
* @since 1.0.0
* @type {number}
*/
public localX: number = 0;
/**
* mouse或touch事件时本地坐标y点
* @property localY
* @public
* @since 1.0.0
* @type {number}
*/
public localY: number = 0;
/**
* 绑定此事件的侦听对象
* @property currentTarget
* @public
* @since 1.0.0
* @type{DisplayObject}
* @default null
*/
public currentTarget: DisplayObject = null;
/**
* 触摸或者鼠标事件的手指唯一标识
* @property identifier
* @type {number}
* @since 1.1.2
* @public
*/
public identifier: any = 0;
/**
* @method MouseEvent
* @public
* @since 1.0.0
* @param {string} type
*/
public constructor(type: string) {
super(type);
this._instanceType = "MouseEvent";
}
/**
* 事件后立即更新显示列表状态
* @method updateAfterEvent
* @since 1.0.9
* @public
*/
public updateAfterEvent() {
this.target.stage._cp = true;
}
public destroy(): void {
//清除相应的数据引用
let s = this;
s.currentTarget = null;
super.destroy();
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
export {default as Circle} from './Circle';
export {default as Ellipse} from './Ellipse';
export {default as Polygon} from './Polygon';
export {default as RoundedRectangle} from './RoundedRectangle';
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment