Project1

标题: 怎样做一个点击图片触发事件的插件 [打印本页]

作者: kys2016    时间: 2017-7-17 14:46
标题: 怎样做一个点击图片触发事件的插件
我想用element.addeventlistener做,但是不知道图片的element名字在哪里找{:2_253:}
作者: kys2016    时间: 2017-7-17 14:54
为什么内置脚本里面只有设定图片属性的内容,表示显示图片的代码在哪里
  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. };
复制代码

作者: 燃烧绳命    时间: 2017-7-18 00:43
YEP图片公共事件插件




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1