1 // args[0] :
\89æ
\91\9c "xxx.png"
2 // args[1] :
\83R
\81[
\83\8b\83o
\83b
\83N
3 // args[2] :
\82±
\82ê
\82ðtrue
\82É
\82·
\82é
\82Æ
\90Ú
\90G
\8fó
\91Ô
\82Å
\8c\88\92è
\83L
\81[
\82Ü
\82½
\82Í
\89º
\83L
\81[
\82ð
\89\9f\82µ
\82½
\82Æ
\82«
\82Ì
\82Ý
\94½
\89\9e(false,
\8fÈ
\97ª
\82¾
\82Æ
\90Ú
\90G
\82µ
\82½
\8fu
\8aÔ
\94½
\89\9e)
5 var FreeItemClass = function(stage, args){
7 FreeItemClass.base.apply(this, arguments);
9 var img = document.createElement('img');
10 img.src = "images/" + args[0]; //
\89æ
\91\9c\82Í
\89¼
16 //
\83A
\83C
\83e
\83\80\82ð
\8eæ
\93¾
\82Å
\82«
\82é
\89ñ
\90\94\81B-1
\82Å
\96³
\8cÀ
19 //
\83A
\83C
\83e
\83\80\82ð
\8eæ
\93¾
\82µ
\82½
\82Æ
\82«
\82É
\8cÄ
\82Î
\82ê
\82é
\83R
\81[
\83\8b\83o
\83b
\83N
\81B
\88ø
\90\94\82É
\83A
\83^
\83b
\83N
\82µ
\82Ä
\82«
\82½
\83I
\83u
\83W
\83F
\83N
\83g
\82ª
\8ew
\92è
\82³
\82ê
\82é
20 //null
\82Å
\89½
\82à
\82µ
\82È
\82¢
\83A
\83C
\83e
\83\80\82É
\82È
\82é
21 this.callback = args[1];
23 //
\8dÅ
\8cã
\82É
\83L
\83\83\83\89\82É
\8fæ
\82ç
\82ê
\82Ä
\82¢
\82é
\8fó
\91Ô
\82Å
\82È
\82
\82È
\82Á
\82Ä
\82©
\82ç
\89½tick
\82Å
\8dÄ
\82Ñ
\8eæ
\93¾
\82Å
\82«
\82é
\82©
\81B
24 this.touchInterval = 0;
25 this.lastTouchedTickCount = -9999;
27 //
\91I
\91ð
\83L
\81[
\89\9f\89º
\8e\9e\82Ì
\82Ý
\83R
\81[
\83\8b\83o
\83b
\83N
\82ð
\94
\8ds
28 this.mustSelectKey = args[2] != undefined ? args[2] : false;
30 this.isPhantom = true;
31 this.debugMode = false;
35 this.isDisabled = false;
36 this.isTouching = false;
38 this.selectKeyPushed = true;
43 this.ownerStage.mainContext.globalAlpha = this.opacity;
44 this.ownerStage.mainContext.drawImage(this.image, x, y, this.size.x, this.size.y);
45 this.ownerStage.mainContext.globalAlpha = 1.0;
47 if(this.debugMode && this.times > 0){
48 //
\8ec
\82è
\8eæ
\93¾
\89ñ
\90\94\82ð
\95\
\8e¦
49 this.ownerStage.mainContext.save();
50 this.ownerStage.mainContext.fillStyle = "rgba(255,255,255,0.5)";
51 this.ownerStage.mainContext.strokeStyle = "rgba(0, 0, 0, 1)";
52 this.ownerStage.mainContext.font = "normal 12px sans-serif";
53 drawText(this.ownerStage.mainContext, this.times, x, y - 20);
54 this.ownerStage.mainContext.restore();
56 var tickCount = this.ownerStage.manager.tickCount;
57 if(this.debugMode && ((tickCount - this.lastTouchedTickCount)< this.touchInterval)){
58 //
\8eæ
\93¾
\82Å
\82«
\82é
\82æ
\82¤
\82É
\82È
\82é
\82Ü
\82Å
\82Ì
\8ec
\82è
\8e\9e\8aÔ
\82ð
\95\
\8e¦
59 this.ownerStage.mainContext.save();
60 this.ownerStage.mainContext.fillStyle = "rgba(255,255,255,0.5)";
61 this.ownerStage.mainContext.strokeStyle = "rgba(0, 0, 0, 1)";
62 this.ownerStage.mainContext.font = "normal 12px sans-serif";
63 drawText(this.ownerStage.mainContext, this.touchInterval - (tickCount - this.lastTouchedTickCount), x, y - 32);
64 this.ownerStage.mainContext.restore();
67 debugDraw: function(x, y){
68 //
\8fÕ
\93Ë
\83}
\83b
\83v
\82É
\95`
\89æ
69 this.ownerStage.collisionMapContext.save();
70 this.ownerStage.collisionMapContext.strokeStyle='rgba(255, 255, 0, 0.5)';
71 this.ownerStage.collisionMapContext.strokeRect(x, y, this.size.x, this.size.y);
72 this.ownerStage.collisionMapContext.restore();
76 if(this.ownerStage.userControlledCharacter)
78 var main = this.ownerStage.userControlledCharacter;
79 if(this.isOverlappedWithLocatedObject(main, main.origin.x, main.origin.y))
81 var tickCount = this.ownerStage.manager.tickCount;
82 if(!this.isDisabled && tickCount - this.lastTouchedTickCount >= this.touchInterval)
84 if((!this.mustSelectKey && !this.isTouching) || (!this.selectKeyPushed && (this.ownerStage.manager.UIManager.keyState.select || this.ownerStage.manager.UIManager.keyState.cursorDown)))
88 this.callback(main,0,0);
96 this.ownerStage.removeStageObject(this);
97 this.isDisabled = true;
100 //
\8dÅ
\8cã
\82É
\90G
\82ç
\82ê
\82½
\8e\9e\8aÔ
\82ð
\8bL
\98^
101 this.lastTouchedTickCount = tickCount;
104 this.selectKeyPushed = this.ownerStage.manager.UIManager.keyState.select || this.ownerStage.manager.UIManager.keyState.cursorDown;
105 this.isTouching = true;
107 this.isTouching = false;
113 FreeItemClass.tick = function(){return false;};