From d217b13c53509803b48f66b2af33e405279803a1 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Thu, 7 May 2015 06:57:25 +0200 Subject: Add loading skin directly from png file --- src/Helpers/Skin/Skin.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'src/Helpers/Skin/Skin.cpp') diff --git a/src/Helpers/Skin/Skin.cpp b/src/Helpers/Skin/Skin.cpp index b421dae..6b36295 100644 --- a/src/Helpers/Skin/Skin.cpp +++ b/src/Helpers/Skin/Skin.cpp @@ -2,7 +2,7 @@ -std::vector skin::loadSkin(std::string skinName){ +std::vector skin::loadShader(std::string skinName){ std::vector skinLoaded; @@ -116,3 +116,52 @@ std::vector skin::extractRGBA(std::string line){ return rgba; } +std::vector skin::loadSkin(std::string skinName){ + sf::Image game; + game.loadFromFile("bin/skin/"+skinName+"/game.png"); + + std::vector skin; + + + + //Background + skin.push_back(game.getPixel(0,0)); //Background MainWindow + skin.push_back(game.getPixel(76,243)); //Background cells + skin.push_back(game.getPixel(61,227)); //Background grid color + skin.push_back(game.getPixel(326,58)); //Score bg + skin.push_back(game.getPixel(441,58)); //Best score bg + skin.push_back(sf::Color(143,122,102)); //Button bg + skin.push_back(sf::Color(238,228,218,186)); //Game over color bg + + //Font + skin.push_back(game.getPixel(65,105)); //Title font color + skin.push_back(game.getPixel(348,78)); //Score title fontcolor + skin.push_back(game.getPixel(468,77)); //Best score title font color + skin.push_back(game.getPixel(400,96)); //Score font color + skin.push_back(game.getPixel(484,97)); //Best score font color + skin.push_back(game.getPixel(128,660)); //2 and 4 font color + skin.push_back(game.getPixel(359,661)); //other number font Color + skin.push_back(sf::Color(143,122,102)); //game over font + + //Skin 2 et le 4 + skin.push_back(game.getPixel(70,597)); //2 + skin.push_back(game.getPixel(190,597)); //4 + + //Skin 8 à 64 + skin.push_back(game.getPixel(311,597)); //8 + skin.push_back(game.getPixel(431,597)); //16 + skin.push_back(game.getPixel(71,477)); //32 + skin.push_back(game.getPixel(191,477)); //64 + + //Skin 128 à 2048 + skin.push_back(game.getPixel(312,477)); //128 + skin.push_back(game.getPixel(431,477)); //256 + skin.push_back(game.getPixel(71,358)); //512 + skin.push_back(game.getPixel(191,358)); //1024 + skin.push_back(game.getPixel(311,358)); //2048 + + //Skin for other number + skin.push_back(game.getPixel(432,358)); //More than 2048 + + return skin; +} -- cgit v1.2.3