Jump to content

text Diacredical Marks pixijs problem?


rossi46
 Share

Recommended Posts

 

I create a game. But when i create text, it lost Diacredical Marks (language is vietnamese). Normal I use style in pixi example, it does not loose Diacredical Marks. But when i remove some stype of text. It loose Diacredical Marks? here is the code full and code where i comment style of text.

window.SamTruyen = window.SamTruyen || {};
//loader
window.SamTruyen.Loader = function () { this.init(); };
window.SamTruyen.Loader.prototype = {
    init: function () {
        var assetImages = ["samtruyen/x2.json"];
        loader.add(assetImages);
        loader.on("progress", this.progress);
        loader.load(this.complete);
    },
    complete: function () {
        AppSt.Game = new window.SamTruyen.Game();
    },
    progress: function () {
    }
};
//bonus
window.SamTruyen.Bonus = function () { this.create(); };
window.SamTruyen.Bonus.prototype = {
};
//x2
window.SamTruyen.X2 = function () { };
window.SamTruyen.X2.prototype = {
    turnLeft: 3,
    init: function() {
        var that = AppSt.Game;
        var ths = AppSt.X2;
        ths.x2Container = new Container();
        that.stage.addChild(ths.x2Container);
        ths.createAssets();
    },
    createAssets: function () {
        var that = AppSt.Game;
        var ths = AppSt.X2;
        var bg = new Sprite(TextureCache["ast_x2-bg.png"]);
        ths.x2Container.addChild(bg);
        bg.position.set(0, 0);
		
        var style = new PIXI.TextStyle({
            fontFamily: 'Times New Roman',
            fontSize: 16,
            fontWeight: 'bold',
            fill: "yellow"
        });

        ths.lblTurn = new PIXI.Text("LƯỢT CÒN LẠI", style);
        ths.lblTurn.position.set(that.renderer.view.width / 2, 71);
        ths.lblTurn.anchor.set(0.5, 0);
		
		ths.x2Container.addChild(ths.lblTurn);
    }
};
//trial
//game
window.SamTruyen.Game = function () { this.create(); };
window.SamTruyen.Game.prototype = {
    game: null, stage: null, renderer: null, smoothie: null, mainContainer: null, containerColumn1: null, containerColumn2: null, containerColumn3: null, containerColumn4: null, containerColumn5: null, mask: null,
    column1: {}, column2: {}, column3: {}, column4: {}, column5: {}, effectContainer: null, iconsContainer: null,
    create: function() {
        PIXI.utils.skipHello();
        this.renderer = new autoDetectRenderer(600, 330, { antialias: false, transparent: true, resolution: 1 });
        $("#game").append(this.renderer.view);
        this.stage = new Container();
        this.smoothie = new Smoothie({ engine: PIXI, renderer: this.renderer, root: this.stage, update: undefined, fps: 120 });
        this.smoothie.start();
        this.mainContainer = new Container();
        this.containerColumn1 = new Container();
        this.containerColumn2 = new Container();
        this.containerColumn3 = new Container();
        this.containerColumn4 = new Container();
        this.containerColumn5 = new Container();
        this.effectContainer = new Container();
        this.iconsContainer = new Container();
		this.mainContainer.addChild(this.containerColumn1, this.containerColumn2, this.containerColumn3, this.containerColumn4, this.containerColumn5, this.iconsContainer);
        this.stage.addChild(this.mainContainer, this.effectContainer);
    }
};
//app
var hubmanagerSt = null;
(function () {
    window.AppSt = {};
    AppSt.AccountID = 0;
    
    AppSt.initGame = function () {
		AppSt.Loader = new window.SamTruyen.Loader();
    }
    AppSt.deleteGame = function () {
    }
})();
$(document).ready(function () {
    AppSt.initGame();
setTimeout(function(){
AppSt.X2 = new SamTruyen.X2();
AppSt.X2.init();
}, 2000);
});
 var style = new PIXI.TextStyle({
            fontFamily: 'Times New Roman',
            fontSize: 16,
            fontWeight: 'bold',
            fill: "yellow", // gradient
            /* stroke: '#4a1850',
            strokeThickness: 5,
            dropShadow: true,
            dropShadowColor: '#000000',
            dropShadowBlur: 4,
            dropShadowAngle: Math.PI / 6,
            dropShadowDistance: 6,
            wordWrap: true,
            wordWrapWidth: 440 */
        });

I have two images. One loose Diacredical Marks and one doesn't loose

have_mark.jpg

lost_mark.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...