Sign in to follow this  
rossi46

text Diacredical Marks pixijs problem?

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.