查看: 3874|回复: 2

[已经解决] 怎样做一个点击图片触发事件的插件

[复制链接]
梦石
0
星屑
50
在线时间
42 小时
注册时间
2017-6-8
回帖
27
发表于 2017-7-17 14:46:27 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
我想用element.addeventlistener做,但是不知道图片的element名字在哪里找{:2_253:}
梦石
0
星屑
50
在线时间
42 小时
注册时间
2017-6-8
回帖
27
 楼主| 发表于 2017-7-17 14:54:37 | 显示全部楼层
为什么内置脚本里面只有设定图片属性的内容,表示显示图片的代码在哪里
  1. Game_Picture.prototype.initTarget = function() {
  2.     this._targetX = this._x;
  3.     this._targetY = this._y;
  4.     this._targetScaleX = this._scaleX;
  5.     this._targetScaleY = this._scaleY;
  6.     this._targetOpacity = this._opacity;
  7.     this._duration = 0;
  8. };

  9. Game_Picture.prototype.initTone = function() {
  10.     this._tone = null;
  11.     this._toneTarget = null;
  12.     this._toneDuration = 0;
  13. };

  14. Game_Picture.prototype.initRotation = function() {
  15.     this._angle = 0;
  16.     this._rotationSpeed = 0;
  17. };

  18. Game_Picture.prototype.show = function(name, origin, x, y, scaleX,
  19.                                        scaleY, opacity, blendMode) {
  20.     this._name = name;
  21.     this._origin = origin;
  22.     this._x = x;
  23.     this._y = y;
  24.     this._scaleX = scaleX;
  25.     this._scaleY = scaleY;
  26.     this._opacity = opacity;
  27.     this._blendMode = blendMode;
  28.     this.initTarget();
  29.     this.initTone();
  30.     this.initRotation();
  31. };
复制代码
回复

使用道具 举报

梦石
0
星屑
230
在线时间
174 小时
注册时间
2016-2-24
回帖
83
发表于 2017-7-18 00:43:41 | 显示全部楼层
YEP图片公共事件插件
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部