Chat Bubble Issue

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

atlogical
Posts: 1
Joined: 21 Jul 2020, 11:52

Chat Bubble Issue

Postby atlogical » 21 Jul 2020, 12:06

Hello.

I just started working on a virtual world based off of the HTML5 client and ran through a problem, which I still wasn't able to get around. Typing anything comes up like so:

Image

Would appreciate any help,
at
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Chat Bubble Issue

Postby Bax » 21 Jul 2020, 15:50

Thank you for reporting the issue.
This is due to the wrong behavior of a function in the createJS library with the latest versions of browsers.
In this Avatar.js file, locate the Avatar.prototype._createBalloon function.
Remove this code:

Code: Select all

var middle = new createjs.Shape();
middle.graphics.beginBitmapFill(createjs.SpriteSheetUtils.extractFrame(balloonSpritesheet, "balloon_middle"));
middle.graphics.rect(0,0,100,10);
middle.graphics.endFill();
middle.name = "middle";
middle.y = top.getBounds().height;
this._balloon.addChild(middle);

And substitute it with the following:

Code: Select all

var middle = new createjs.Sprite(balloonSpritesheet);
middle.gotoAndStop("balloon_middle");
middle.name = "middle";
this._balloon.addChild(middle);

Then, in the same file, locate the Avatar.prototype._updateBalloon function and BEFORE this line:

Code: Select all

middle.scaleY = text.getBounds().height / 10;

add the following:

Code: Select all

middle.y = top.getBounds().height;

That black rectangle should now be removed and the message visible in the chat bubble.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Chat Bubble Issue

Postby Bax » 21 Jul 2020, 16:00

We just published an updated examples package which fixes the issue. Again, thank you for reporting.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 27 guests