Skip to content

Commit

Permalink
Make it Persion
Browse files Browse the repository at this point in the history
RTL-ing CSSs and stuff
  • Loading branch information
alifzl committed Apr 25, 2019
1 parent ddf8e0d commit 4da517c
Show file tree
Hide file tree
Showing 24 changed files with 366 additions and 1,095 deletions.
116 changes: 0 additions & 116 deletions LICENSE.txt

This file was deleted.

Binary file added Persian-CoverImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/Cairo-Regular.ttf
Binary file not shown.
Binary file removed css/Poppins-Medium.ttf
Binary file not shown.
6 changes: 3 additions & 3 deletions css/game.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@font-face {
font-family: 'Poppins';
font-family: 'Cairo';
font-style: normal;
font-weight: 400;
src: url('Poppins-Medium.ttf') format('truetype');
src: url('Cairo-Regular.ttf') format('truetype');
}

html, body{
width: 100%;
height: 100%;
}
body{
font-family: 'Poppins';
font-family: 'Cairo';
margin: 0;
background: #222;
position:relative;
Expand Down
19 changes: 11 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<html>
<html>
<head>
<link rel="stylesheet" href="css/game.css">
</head>
<body>
<div id="stage"></div>
<div id="modal_shade"></div>
<div class="overlay" id="warning">
<div>oh noes</div>
<div>
<div dir="rtl">ای بابا!</div>
<div dir="rtl">
your browser doesn't support webgl.<br>
try a different browser or computer?
try a different browser or computer?<br>
<br>
مرورگر شما مرخص است! از یه مرورگر و یا کامپیوتر دیگه استفاده کنید!
</div>
</div>
<div class="overlay" id="paused">
<div>paused</div>
<div>
click anywhere to resume
<div dir="rtl">
click anywhere to resume<br>
برای بازگشت رو یه جا رو کلیک کن!
</div>
</div>
</body>
Expand Down Expand Up @@ -96,6 +99,6 @@
document.getElementById("warning").style.display = "block";
}
};
window.SHARE_TEXT = "I just played this really weird game about the news. WE BECOME WHAT WE BEHOLD:"
window.SHARE_URL = "https://ncase.itch.io/wbwwb";
window.SHARE_TEXT = 'همین الان یه بازی خیلی خفن رو بازی کردم'
window.SHARE_URL = "";
</script>
20 changes: 8 additions & 12 deletions js/game/TV.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function TV(scene){
// Chryon container
var chyron = new PIXI.Container();
chyron.alpha = 0;
chyron.x = -15;
chyron.x = +15;
Tween_get(chyron).to({alpha:1}, _s(0.5), Ease.quadInOut);
Tween_get(chyron).to({x:0}, _s(0.8), Ease.quadInOut);
photoContainer.addChild(chyron);
Expand All @@ -92,20 +92,16 @@ function TV(scene){

// Chyron Text
if(!options.nothing){
if(language == "JP"){
var fontsize=100, max=9;
} else{
var fontsize=100, max=14;
}
if(text.length>max){ // more than [max] chars...
fontsize = Math.floor(max*fontsize/text.length);
}
var text = new PIXI.Text(text, {font:"bold "+fontsize+"px Poppins", fill:"#FFF"});
var fontsize=50; //, max=14;
//if(text.length>max){ // more than [max] chars...
// fontsize = Math.floor(max*fontsize/text.length);
//}
var text = new PIXI.Text(text + "\n", {font:"bold "+fontsize+"px Cairo", align:"right", fill:"#FFF"}); // \n hack. needed when the text field cuts some of the string font's bottom
text.scale.x = text.scale.y = 0.2;
text.anchor.x = 0;
text.anchor.y = 0.5;
text.x = 45;
text.y = 115;
text.x = 30;
text.y = 120;
chyron.addChild(text);
}

Expand Down
43 changes: 20 additions & 23 deletions js/scenes/Scene_Credits.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ function Scene_Credits(){
}

// add text
var createdByText = new PIXI.Text(textStrings["createdBy"], {font: "46px Times", fill:"#FFFFFF", align: "left"});
var createdByText = new PIXI.Text(textStrings["createdBy"] + "\n", {font: "46px Cairo", fill:"#FFFFFF", align: "left"});
createdByText.anchor.x = 0.0;
createdByText.anchor.y = 0.5;
createdByText.x = Game.width / 2 - 240;
createdByText.y = Game.height / 2 - 41;
c[1].addChild(createdByText);

var authorText = new PIXI.Text(textStrings["NickyCase"], {font: "86px Times", fill:"#FFFFFF", align: "left"});
var authorText = new PIXI.Text(textStrings["NickyCase"], {font: "86px Cairo", fill:"#FFFFFF", align: "left"});
authorText.anchor.x = 0.0;
authorText.anchor.y = 0.5;
authorText.x = Game.width / 2 - 240;
authorText.y = Game.height / 2 + 29;
c[1].addChild(authorText);

var playtestersText = new PIXI.Text(textStrings["manyThanks"], {font: "44px Times", fill:"#FFFFFF", align: "right"});
var playtestersText = new PIXI.Text(textStrings["manyThanks"] + "\n", {font: "44px Cairo", fill:"#FFFFFF", align: "right"});
playtestersText.anchor.x = 1.0;
playtestersText.anchor.y = 0.5;
playtestersText.x = Game.width / 2 + 262;
Expand All @@ -51,48 +51,45 @@ function Scene_Credits(){

// @TODO: Yes, I feel physical pain hacking this in the way I did in the following lines,
// but I don't know PIXI enough to do this properly... /sl
// Alex: Nicky, hold my beer. I can top this hack.

var supportersText1 = new PIXI.Text(textStrings["patreonSupporters"], {font: "45px Times", fill:"#FFFFFF", align: "left"});
var supportersText1 = new PIXI.Text(textStrings["patreonSupporters"] + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nasdfasdfasdfsadfasdfasdfasdfasdf", {font: "40px Cairo", fill:"#FFFFFF", align: "left"});
supportersText1.anchor.x = 0.0;
supportersText1.anchor.y = 0.5;
supportersText1.x = 63;
supportersText1.y = 111;
supportersText1.x = 145;
supportersText1.y = 80;
c[3].addChild(supportersText1);

var supportersText2 = new PIXI.Text(textStrings["patreonSupporters"], {font: "45px Times", fill:"#FFFFFF", align: "left"});
var supportersText2 = new PIXI.Text(textStrings["patreonSupporters"] + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nasdfasdfasdfsadfasdfasdfasdfasdf", {font: "40px Cairo", fill:"#FFFFFF", align: "left"});
supportersText2.anchor.x = 0.0;
supportersText2.anchor.y = 0.5;
supportersText2.x = 63;
supportersText2.y = 111;
supportersText2.x = 145;
supportersText2.y = 80;
c[4].addChild(supportersText2);

var supportersText3 = new PIXI.Text(textStrings["patreonSupporters"], {font: "45px Times", fill:"#FFFFFF", align: "left"});
var supportersText3 = new PIXI.Text(textStrings["patreonSupporters"] + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nasdfasdfasdfsadfasdfasdfasdfasdf", {font: "40px Cairo", fill:"#FFFFFF", align: "left"});
supportersText3.anchor.x = 0.0;
supportersText3.anchor.y = 0.5;
supportersText3.x = 63;
supportersText3.y = 111;
supportersText3.x = 145;
supportersText3.y = 80;
c[5].addChild(supportersText3);

var supportersText4 = new PIXI.Text(textStrings["patreonSupporters"], {font: "45px Times", fill:"#FFFFFF", align: "left"});
var supportersText4 = new PIXI.Text(textStrings["patreonSupporters"] + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nasdfasdfasdfsadfasdfasdfasdfasdf", {font: "40px Cairo", fill:"#FFFFFF", align: "left"});
supportersText4.anchor.x = 0.0;
supportersText4.anchor.y = 0.5;
supportersText4.x = 63;
supportersText4.y = 111;
supportersText4.x = 145;
supportersText4.y = 80;
c[6].addChild(supportersText4);

// thankYouText comes before finallyText so finallyText can be aligned based on thankYouText. /sl
var thankYouText = new PIXI.Text(textStrings["thankYouForPlaying"], {font: "55px Times", fill:"#FFFFFF", align: "center"});
var thankYouText = new PIXI.Text(textStrings["thankYouForPlaying"] + "\n ", {font: "55px Cairo", fill:"#FFFFFF", align: "center"});
thankYouText.anchor.x = 0.5;
thankYouText.anchor.y = 0.5;
thankYouText.x = Game.width / 2 + 10;
thankYouText.y = Game.height / 2 + 25;
c[8].addChild(thankYouText);

var finallyText = new PIXI.Text(textStrings["lastButNotLeast"], {font: "37px Times", fill:"#FFFFFF", align: "left"});
var finallyText = new PIXI.Text(textStrings["lastButNotLeast"] + "\n", {font: "37px Cairo", fill:"#FFFFFF", align: "left"});
finallyText.anchor.x = 0.0;
finallyText.anchor.y = 0.5;
finallyText.x = thankYouText.getBounds().x;
finallyText.y = Game.height / 2 - 30;
finallyText.x = thankYouText.getBounds().x + thankYouText.width - finallyText.width;
finallyText.y = Game.height / 2 - 45;
c[7].addChild(finallyText);

// TWEEN ANIM
Expand Down
17 changes: 9 additions & 8 deletions js/scenes/Scene_Post_Post_Credits.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Game.addToManifest({
Game.addToManifest({

logo: "sprites/postcredits/logo.png",

Expand Down Expand Up @@ -29,7 +29,7 @@ function Scene_Post_Post_Credits(){

var button = new PIXI.Container();
button.x = x;
button.y = 280;
button.y = 325;
cont.addChild(button);

var bg = MakeMovieClip("end_button");
Expand Down Expand Up @@ -61,10 +61,10 @@ function Scene_Post_Post_Credits(){

};
_addButton(250, 2, function(){
window.open("http://ncase.me");
window.open("http://afzl95.github.io/");
});
_addButton(480, 3, function(){
window.open("https://www.patreon.com/ncase");
window.open("https://twitter.com/ali_fzl95");
});
_addButton(710, 4, function(){
Game.sceneManager.gotoScene("Quote");
Expand All @@ -75,7 +75,7 @@ function Scene_Post_Post_Credits(){

var button = MakeSprite(icon);
button.x = x;
button.y = 342;
button.y = 419;
button.anchor.x = button.anchor.y = 0.5;
cont.addChild(button);

Expand All @@ -98,12 +98,13 @@ function Scene_Post_Post_Credits(){
};
var text = encodeURIComponent(window.SHARE_TEXT);
var url = encodeURIComponent(window.SHARE_URL);
_addSocialButton(575, "facebook", function(){
_addSocialButton(Game.width/2 - 38, "facebook", function(){
var href = "https://www.facebook.com/sharer/sharer.php?u="+url+"&t="+text;
window.open(href);
});
_addSocialButton(610, "twitter", function(){
var href = "https://twitter.com/intent/tweet?text="+text+"%20"+url+"&via=ncasenmare";
_addSocialButton(Game.width/2 + 13, "twitter", function(){
var href = "https://twitter.com/intent/tweet?text="+text+"%0a"+url;
//var href = "https://twitter.com/intent/tweet?text="+text+"%20"+url+"&via=ncasenmare";
window.open(href);
});

Expand Down
10 changes: 5 additions & 5 deletions js/scenes/Scene_Preloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@ function Scene_Preloader(){
var bar = MakeMovieClip("preload_play");
bar.anchor.x = bar.anchor.y = 0.5;
bar.x = 278;
bar.y = 225;
bar.y = 250;
Game.stage.addChild(bar);
var barEase = 0.9;

// Loading text
var text = new PIXI.Text("loading... 0%", {font:"25px Poppins", fill:"#4C4C4C", align:"center"});
var text = new PIXI.Text("loading... 0%", {font:"25px Cairo", fill:"#4C4C4C", align:"center"});
text.anchor.x = 0.5;
text.anchor.y = 0.5;
text.x = bar.x;
text.y = bar.y;
Game.stage.addChild(text);

// Playing time text
var playingTimeText = new PIXI.Text(textStrings["playingTime"], { font: "32px Poppins", fill: "#FFFFFF", align: "center" });
var playingTimeText = new PIXI.Text(textStrings["playingTime"] + "\n", { font: "32px Cairo", fill: "#FFFFFF", align: "center" }); // \n hack. needed when the text field cuts some of the string font's bottom
playingTimeText.anchor.x = 0.5;
playingTimeText.anchor.y = 0.5;
playingTimeText.x = bar.x;
playingTimeText.y = 300;
playingTimeText.y = 345;
Game.stage.addChild(playingTimeText);

// Warning text
var warningText = new PIXI.Text(textStrings["warning"], { font: "25px Poppins", fill: "#666666", align: "center" });
var warningText = new PIXI.Text(textStrings["warning"], { font: "25px Cairo", fill: "#666666", align: "center" });
warningText.anchor.x = 0.5;
warningText.anchor.y = 0.5;
warningText.x = bar.x;
Expand Down
Loading

0 comments on commit 4da517c

Please sign in to comment.