效果图:
思路:
1.分析将荣3可以得知,其国界为横六边形的中线相连来得到竖六边形(如下图),所有首先确定各自是否是国界
2.根据其素材显示,其绘制核心分为内部与外部
3.内部采用地块的颜色,外部采用相邻的国界颜色
实现步骤:
1.生成素材
1.先准备出边界素材
2.根据其六边状态来合成图片
public static void drawPixmapForCountryBorder(){ Pixmap c1=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_1.png")); Pixmap c2=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_2.png")); Pixmap c3=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_3.png")); Pixmap c4=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_4.png")); Pixmap c5=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_5.png")); Pixmap c6=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_6.png")); Pixmap c11=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_11.png")); Pixmap c12=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_12.png")); Pixmap c13=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_13.png")); Pixmap c14=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_14.png")); Pixmap c15=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_15.png")); Pixmap c16=new Pixmap(Gdx.files.internal(ResDefaultConfig.Path.TempPixmapFolderPath+"countryBorder_16.png")); Pixmap pixmap1=new Pixmap(c1.getWidth(), c1.getHeight(), Pixmap.Format.RGBA8888); Pixmap pixmap2=new Pixmap(c1.getWidth(), c1.getHeight(), Pixmap.Format.RGBA8888); for(int i=1;i<=63;i++){ pixmap1.fill(); pixmap2.fill(); String border=GameMethod.transFBorderIdForString(i); boolean b1=true,b2=true,b3=true,b4=true,b5=true,b6=true; if(border.substring(0,1).equals("0")){ b1=false; } if(border.substring(1,2).equals("0")){ b2=false; } if(border.substring(2,3).equals("0")){ b3=false; } if(border.substring(3,4).equals("0")){ b4=false; } if(border.substring(4,5).equals("0")){ b5=false; } if(border.substring(5,6).equals("0")){ b6=false; } if(b1){ pixmap1.drawPixmap(c1,0,0); pixmap2.drawPixmap(c11,0,0); } if(b2){ pixmap1.drawPixmap(c2,0,0); pixmap2.drawPixmap(c12,0,0); } if(b3){ pixmap1.drawPixmap(c3,0,0); pixmap2.drawPixmap(c13,0,0); } if(b4){ pixmap1.drawPixmap(c4,0,0); pixmap2.drawPixmap(c14,0,0); } if(b5){ pixmap1.drawPixmap(c5,0,0); pixmap2.drawPixmap(c15,0,0); } if(b6){ pixmap1.drawPixmap(c6,0,0); pixmap2.drawPixmap(c16,0,0); } PixmapIO.writePNG(Gdx.files.external("countryInteralBorder_"+i+".png"), pixmap1); PixmapIO.writePNG(Gdx.files.external("countryExternalBorder_"+i+".png"), pixmap2); } c1.dispose(); c2.dispose(); c3.dispose(); c4.dispose(); c5.dispose(); c6.dispose(); c11.dispose(); c12.dispose(); c13.dispose(); c14.dispose(); c15.dispose(); c16.dispose(); pixmap1.dispose(); pixmap2.dispose(); }
public static String transFBorderIdForString(int borderIdF) { switch (borderIdF) { case 0: return "000000"; case 1: return "000001"; case 2: return "000010"; case 3: return "000011"; case 4: return "000100"; case 5: return "000101"; case 6: return "000110"; case 7: return "000111"; case 8: return "001000"; case 9: return "001001"; case 10: return "001010"; case 11: return "001011"; case 12: return "001100"; case 13: return "001101"; case 14: return "001110"; case 15: return "001111"; case 16: return "010000"; case 17: return "010001"; case 18: return "010010"; case 19: return "010011"; case 20: return "010100"; case 21: return "010101"; case 22: return "010110"; case 23: return "010111"; case 24: return "011000"; case 25: return "011001"; case 26: return "011010"; case 27: return "011011"; case 28: return "011100"; case 29: return "011101"; case 30: return "011110"; case 31: return "011111"; case 32: return "100000"; case 33: return "100001"; case 34: return "100010"; case 35: return "100011"; case 36: return "100100"; case 37: return "100101"; case 38: return "100110"; case 39: return "100111"; case 40: return "101000"; case 41: return "101001"; case 42: return "101010"; case 43: return "101011"; case 44: return "101100"; case 45: return "101101"; case 46: return "101110"; case 47: return "101111"; case 48: return "110000"; case 49: return "110001"; case 50: return "110010"; case 51: return "110011"; case 52: return "110100"; case 53: return "110101"; case 54: return "110110"; case 55: return "110111"; case 56: return "111000"; case 57: return "111001"; case 58: return "111010"; case 59: return "111011"; case 60: return "111100"; case 61: return "111101"; case 62: return "111110"; case 63: return "111111"; } return "000000"; }
会生成内边界和外边界各63个图
而根据统计,国界只会使用以下几种形式: 单边,单边对立,相连
3.首先绘制内边界,颜色以该地块颜色为主
if(h.regionLineBorderTile!=null){ if (h.getRegionId() != -1&&smapDao.getLegionIndexByRegion(h.getRegionId())!=0) { color=smapDao.getOppositeColorForRegion(h.getHexagonIndex(),false,defaultColor); batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } if(cam.loopState==0||cam.loopState==1){ batch.draw(h.regionLineBorderTile.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.regionLineBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.regionLineBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.regionLineBorderTile.getW(),h.regionLineBorderTile.getH(),1,1,0); } if(cam.loopState==1||cam.loopState==2){ batch.draw(h.regionLineBorderTile.getTextureRegion(), mapW_px+h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.regionLineBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.regionLineBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.regionLineBorderTile.getW(),h.regionLineBorderTile.getH(),1,1,0); } }
countryBorder1=ifCountryBorderX(getHexagonIndex(),1);//1↗ 2→ 3↘ 4↙ 5← 6↖ countryBorder2=ifCountryBorderX(getHexagonIndex(),2); countryBorder3=ifCountryBorderX(getHexagonIndex(),3); countryBorder4=ifCountryBorderX(getHexagonIndex(),4); countryBorder5=ifCountryBorderX(getHexagonIndex(),5); countryBorder6=ifCountryBorderX(getHexagonIndex(),6); countryBorder =GameMethod.getFBorderId(countryBorder1,countryBorder2,countryBorder3,countryBorder4,countryBorder5,countryBorder6); countryInnerBorderTile=game.getImgLists().getTextureByName("countryInteralBorder_"+countryBorder);
//获得纵六边形国界的类型 //direct 1↗ 2→ 3↘ 4↙ 5← 6↖ public boolean ifCountryBorderX(int id,int direct){ switch (direct){ case 1: if(ifCountryBorder(id,2,true)&& ifCountryBorder(id,3,true)){ return true; } break; case 2: if(ifCountryBorder(id,3,true)&& ifCountryBorder(id,6,true)){ return true; } break; case 3: if(ifCountryBorder(id,5,true)&& ifCountryBorder(id,6,true)){ return true; } break; case 4: if(ifCountryBorder(id,4,true)&& ifCountryBorder(id,5,true)){ return true; } break; case 5: if(ifCountryBorder(id,1,true)&& ifCountryBorder(id,4,true)){ return true; } break; case 6: if(ifCountryBorder(id,1,true)&& ifCountryBorder(id,2,true)){ return true; } break; } return false; } //获取绘制的类型 public static int getFBorderId(boolean t1, boolean t2, boolean t3, boolean t4, boolean t5, boolean t6) { if (t1) { if (t2) { if (t3) { if (t4) { if (t5) { if (t6) { return 63; } else { return 62; } } else { if (t6) { return 61; } else { return 60; } } } else { if (t5) { if (t6) { return 59; } else { return 58; } } else { if (t6) { return 57; } else { return 56; } } } } else { if (t4) { if (t5) { if (t6) { return 55; } else { return 54; } } else { if (t6) { return 53; } else { return 52; } } } else { if (t5) { if (t6) { return 51; } else { return 50; } } else { if (t6) { return 49; } else { return 48; } } } } } else { if (t3) { if (t4) { if (t5) { if (t6) { return 47; } else { return 46; } } else { if (t6) { return 45; } else { return 44; } } } else { if (t5) { if (t6) { return 43; } else { return 42; } } else { if (t6) { return 41; } else { return 40; } } } } else { if (t4) { if (t5) { if (t6) { return 39; } else { return 38; } } else { if (t6) { return 37; } else { return 36; } } } else { if (t5) { if (t6) { return 35; } else { return 34; } } else { if (t6) { return 33; } else { return 32; } } } } } } else {//t1 if (t2) { if (t3) { if (t4) { if (t5) { if (t6) { return 31; } else { return 30; } } else { if (t6) { return 29; } else { return 28; } } } else { if (t5) { if (t6) { return 27; } else { return 26; } } else { if (t6) { return 25; } else { return 24; } } } } else { if (t4) { if (t5) { if (t6) { return 23; } else { return 22; } } else { if (t6) { return 21; } else { return 20; } } } else { if (t5) { if (t6) { return 19; } else { return 18; } } else { if (t6) { return 17; } else { return 16; } } } } } else { if (t3) { if (t4) { if (t5) { if (t6) { return 15; } else { return 14; } } else { if (t6) { return 13; } else { return 12; } } } else { if (t5) { if (t6) { return 11; } else { return 10; } } else { if (t6) { return 9; } else { return 8; } } } } else { if (t4) { if (t5) { if (t6) { return 7; } else { return 6; } } else { if (t6) { return 5; } else { return 4; } } } else { if (t5) { if (t6) { return 3; } else { return 2; } } else { if (t6) { return 1; } else { return 0; } } } } } } }
效果如下图:
4.绘制外边界图:
颜色采用地块的默认颜色,绘制方法也同内边界绘制方法一样
//这里国家准备了两种颜色 普通色和fog色,根据国家状态反着获取 public Color getOppositeColorForRegion(int hexagon,Boolean ifFog,Color defaultColor) { hexagon=getRegionId(hexagon); if(masterData.ifColor==1){ int li=getLegionIndexByRegion(hexagon); if(li==-1||legionDatas.get(li).getInternIndex()==0||hexagonDatas.get(hexagon).getBlockType()==1){ return defaultColor; }else if(ifAllyPlayerByRegion(hexagon)){ return legionFogColors.get(li); }else { if(ifFog){ return legionFogColors.get(li); }else{ return legionColors.get(li); } } }else { return defaultColor; } }
效果如下图
所以外边界应该采用的是邻边的颜色来绘制,
public Color getOuterColor(Color defaultColor) { int borderId = getBorderIdByDirect(this.getHexagonIndex(), GameMethod.getDirectForColor(countryBorder1,countryBorder2,countryBorder3,countryBorder4,countryBorder5,countryBorder6));//1↗ 2→ 3↘ 4↙ 5← 6↖ HexagonData h=getHexagonData(borderId); if (this.getRegionId() != -1 &&!h.ifSeaLand) { defaultColor = getOppositeColorForRegion(borderId, false, defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ } return defaultColor; }
效果如下:
5.但我们会发现在多国交界处会产生颜色交汇,这里我的处理方法是这种多国交界处单独拿出来一个一个绘制,同时对交汇处判断,结汇处不绘制外边界,
private boolean ifMoreCountryBorder() {//是否有两个以上的国家 int i1=-1; int i2=-1; for(int i=0;i<=6;i++){ int id=getBorderIdByDirect(hexagonIndex,i); BuildData b=getBuildDataByRegion(Fb2Smap.this.getRegionId(id)); if(b!=null){ if(i1==-1||i1==b.getLegionIndex()){ i1=b.getLegionIndex(); }else if(i2==-1||i2==b.getLegionIndex()){ i2=b.getLegionIndex(); }else if(i1!=b.getLegionIndex()&&i2!=b.getLegionIndex()){ return true; } } } return false; }
//0全部 1↖ 2上 3↗ 4↙ 5↓ 6↘ public int getBorderIdByDirect(int id, int direct) { if(direct==0){ return id; } boolean top = false; boolean foot = false; boolean left = false; boolean right = false; //判断处于哪个边 int y = (int) id / masterData.getWidth(); int x = id - y * masterData.getWidth(); int t1, t2, t3, t4, t5, t6; boolean ifParity = (x & 1) == 1; if (ifParity) { t1 = id - 1; t2 = id - masterData.getWidth(); t3 = id + 1; t4 = id + masterData.getWidth() - 1; t5 = id + masterData.getWidth(); t6 = id + masterData.getWidth() + 1; } else { t1 = id - masterData.getWidth() - 1; t2 = id - masterData.getWidth(); t3 = id - masterData.getWidth() + 1; t4 = id - 1; t5 = id + masterData.getWidth(); t6 = id + 1; } if (x == 0) { left = true; } if (x == masterData.getWidth() - 1) { right = true; } if (y == 0) { top = true; } if (y == masterData.getWidth() - 1) { foot = true; } if (ifLoop) { if (ifParity) { if ( direct == 1) { return(t1); } if (!top) { if ( direct == 2) { return(t2); } } if ( direct == 3) { return(t3); } if (!foot) { if ( direct == 4) { return(t4); } if ( direct == 5) { return(t5); } if ( direct == 6) { return(t6); } } } else { if (!top) { if ( direct == 1) { return(t1); } if ( direct == 2) { return(t2); } if ( direct == 3) { return(t3); } } if ( direct == 4) { return(t4); } if (!foot) { if ( direct == 5) { return(t5); } } if ( direct == 6) { return(t6); } } } else { if (ifParity) { if (!left) { if ( direct == 1) { return(t1); } } if (!top) { if ( direct == 2) { return(t2); } } if (!right) { if ( direct == 3) { return(t3); } } if (!foot && !left) { if ( direct == 4) { return(t4); } } if (!foot) { if ( direct == 5) { return(t5); } } if (!foot && !right) { if ( direct == 6) { return(t6); } } } else { if (!top && !left) { if ( direct == 1) { return(t1); } } if (!top) { if ( direct == 2) { return(t2); } } if (!top && !right) { if ( direct == 3) { return(t3); } } if (!left) { if ( direct == 4) { return(t4); } } if (!foot) { if ( direct == 5) { return(t5); } } if (!right) { if ( direct == 6) { return t6; } } } } return -1; }
if(h.ifMoreCountryBorder){ int borderId1=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 1); int borderId2=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 2); int borderId3=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 3); int borderId4=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 4); int borderId5=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 5); int borderId6=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 6); Fb2Smap.HexagonData hb1=smapDao.getHexagonData(borderId1); Fb2Smap.HexagonData hb2=smapDao.getHexagonData(borderId2); Fb2Smap.HexagonData hb3=smapDao.getHexagonData(borderId3); Fb2Smap.HexagonData hb4=smapDao.getHexagonData(borderId4); Fb2Smap.HexagonData hb5=smapDao.getHexagonData(borderId5); Fb2Smap.HexagonData hb6=smapDao.getHexagonData(borderId6); int li1=hb1.getRegionLegionIndex(); int li2=hb2.getRegionLegionIndex(); int li3=hb3.getRegionLegionIndex(); int li4=hb4.getRegionLegionIndex(); int li5=hb5.getRegionLegionIndex(); int li6=hb6.getRegionLegionIndex(); if (h.countryBorder1) {//1↗ 2→ 3↘ 4↙ 5← 6↖ //borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 2); //Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb2!=null&&hb3!=null&&((li2==li3)||(!hb2.ifMoreCountryBorder&&!hb3.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb2.ifSeaLand) { color=smapDao.getOppositeColorForRegion(borderId2,false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO11.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO11.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO11.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO11.getW(), cam.rescource.countryBorderDAO11.getH(), 1, 1, 0); } } if (h.countryBorder2) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 3); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb6!=null&&hb3!=null&&((li6==li3)||(!hb6.ifMoreCountryBorder&&!hb3.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb3.ifSeaLand) { color=smapDao.getOppositeColorForRegion(borderId3,false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO12.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO12.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO12.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO12.getW(), cam.rescource.countryBorderDAO12.getH(), 1, 1, 0); } } if (h.countryBorder3) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 6); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb5!=null&&hb6!=null&&((li5==li6)||(!hb5.ifMoreCountryBorder&&!hb6.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb6.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId6, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO13.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO13.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO13.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO13.getW(), cam.rescource.countryBorderDAO13.getH(), 1, 1, 0); } } if (h.countryBorder4) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 5); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb4!=null&&hb5!=null&&((li4==li5)||(!hb4.ifMoreCountryBorder&&!hb5.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb5.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId5, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO14.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO14.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO14.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO14.getW(), cam.rescource.countryBorderDAO14.getH(), 1, 1, 0); } } if (h.countryBorder5) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 4); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb1!=null&&hb4!=null&&((li1==li4)||(!hb1.ifMoreCountryBorder&&!hb4.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb4.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId4, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO15.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO15.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO15.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO15.getW(), cam.rescource.countryBorderDAO15.getH(), 1, 1, 0); } } if (h.countryBorder6) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 1); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb1!=null&&hb2!=null&&((li1==li2)||(!hb1.ifMoreCountryBorder&&!hb2.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb1.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId1, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO16.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO16.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO16.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO16.getW(), cam.rescource.countryBorderDAO16.getH(), 1, 1, 0); } } }else{ /* if(h.getHexagonIndex()==6616){ int s=0; }*/ if (h.getRegionId() != -1) { color=h.getOuterColor(defaultColor); // color=smapDao.getOppositeColorForRegion(h.getHexagonIndex(),false,defaultColor); batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } if(h.countryOuterBorderTile!=null){ batch.draw(h.countryOuterBorderTile.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.countryOuterBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.countryOuterBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.countryOuterBorderTile.getW(),h.countryOuterBorderTile.getH(),1,1,0); } }
效果如下:
基本实现类了我们想要的效果
//完整代码
public static void drawAllTileForMap(MainGame game,Batch batch,Fb2Smap smapDao, CamerDAO cam, float scale, int mapW_px, int mapH_px,boolean ifDrawColor) { if (smapDao.hexagonDatas != null && smapDao.hexagonDatas.size > 0) { //smapDao.setHexagonDataIfDrawIsFalse(); int x = 0; int y = 0; //先绘制海岸 //沿海地块用圆形来填充 // Gdx.app.log("setColor1","begin"+" "); int i = 0, j = 0,id,iMax = cam.cw+2,jMax=cam.ch+3; for (; j<jMax; j++) { for (i=0;i<iMax; i++) { x=cam.csx+i; if(smapDao.ifLoop&&x>smapDao.masterData.getWidth()){ x=x-smapDao.masterData.getWidth(); } y=cam.csy+j; id=x-1+(y-1)*smapDao.masterData.getWidth(); if ( id>=0&&id<smapDao.hexagonDatas.size ) { Fb2Smap.HexagonData h=smapDao.hexagonDatas.get(id); /*if(id==51535){ int s=0; }*/ //h.setIfDraw(true); //Gdx.app.log("海陆绘制圆", "" + id); if(cam.loopState==0||cam.loopState==1){ if(h.tile1!=null&&h.getBlockType()!=1){ batch.draw(h.tile1.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.tile1.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.tile1.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.tile1.getW(),h.tile1.getH(),1,1,0); } if(h.tile2!=null){ batch.draw(h.tile2.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.tile2.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.tile2.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.tile2.getW(),h.tile2.getH(),1,1,0); } } if(cam.loopState==1||cam.loopState==2){ if(h.tile1!=null&&h.getBlockType()!=1){ batch.draw(h.tile1.getTextureRegion(), h.source_x+mapW_px+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.tile1.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.tile1.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.tile1.getW(),h.tile1.getH(),1,1,0); } if(h.tile2!=null){ batch.draw(h.tile2.getTextureRegion(), h.source_x+mapW_px+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.tile2.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.tile2.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.tile2.getW(),h.tile2.getH(),1,1,0); } } //Gdx.app.log("updColor","id:"+id+" legion:"+(Integer) regionColors.get(mapBinDAO.getMapbin().get(id).getPolitical())); } } } //再额外绘制一层海陆以及陆地颜色 Color defaultColor=Color.DARK_GRAY; i = 0; j = 0;Color color=Color.CLEAR; int nowCamp=-2; int nextCamp = -2; //int policy; for (; j<jMax; j++) { for (i=0;i<iMax; i++) { x=cam.csx+i; if(smapDao.ifLoop&&x>smapDao.masterData.getWidth()){ x=x-smapDao.masterData.getWidth(); } y=cam.csy+j; id=x-1+(y-1)*smapDao.masterData.getWidth(); if ( id>=0&&id<smapDao.hexagonDatas.size ) { Fb2Smap.HexagonData h=smapDao.hexagonDatas.get(id); /*if(id==15117){ int s=0; }*/ //h.setIfDraw(true); //Gdx.app.log("海陆绘制圆", "" + id); if( h.getBackTile()!=1&&h.getRegionLegionIndex()!=0){ if(ifDrawColor){ if (h.getRegionId() != -1) { color=smapDao.getColorForRegion(h.getHexagonIndex()); } else { color = Color.CLEAR; } // batch.setColor(color); if(cam.rescource.ifDrawArmyMark&&smapDao.getGame().gameConfig.ifEffect){ batch.setColor(color.r,color.g,color.b,color.a*1.5f); }else { batch.setColor(color); } }else { nowCamp=h.getCamp(); if (nowCamp != nextCamp) { // color=smapDao.getColorByCamp(h.getRegionId()); color=DefDAO.getColorForCamp(nowCamp); nextCamp =nowCamp; //Gdx.app.log("setColor","id:"+id+" color:"+color); } batch.setColor(color.r,color.g,color.b,0.3f); } if(game.gameConfig.ifEffect&&cam.rescource.ifDrawArmyMark&&h.getBuildData().ifDrawWarLine()){ if(cam.loopState==0||cam.loopState==1){ batch.draw(cam.rescource.hexagonDAO1.getTextureRegion(), h.source_x-cam.rescource.hexagonDAO1.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y-cam.rescource.hexagonDAO1.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,cam.rescource.hexagonDAO1.getW(),cam.rescource.hexagonDAO1.getH(),1,1,0); } if(cam.loopState==1||cam.loopState==2){ batch.draw(cam.rescource.hexagonDAO1.getTextureRegion(), mapW_px+h.source_x-cam.rescource.hexagonDAO1.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y-cam.rescource.hexagonDAO1.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,cam.rescource.hexagonDAO1.getW(),cam.rescource.hexagonDAO1.getH(),1,1,0); } }else{ if(cam.loopState==0||cam.loopState==1){ batch.draw(cam.rescource.hexagonDAO.getTextureRegion(), h.source_x-cam.rescource.hexagonDAO.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y-cam.rescource.hexagonDAO.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,cam.rescource.hexagonDAO.getW(),cam.rescource.hexagonDAO.getH(),1,1,0); } if(cam.loopState==1||cam.loopState==2){ batch.draw(cam.rescource.hexagonDAO.getTextureRegion(), mapW_px+h.source_x-cam.rescource.hexagonDAO.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y-cam.rescource.hexagonDAO.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,cam.rescource.hexagonDAO.getW(),cam.rescource.hexagonDAO.getH(),1,1,0); } } batch.setColor(Color.WHITE); } if(h.getBlockType()==1){ batch.setColor(1,1,1,1); if(h.tile2!=null){ if(cam.loopState==0||cam.loopState==1){ batch.draw(h.tile2.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.tile2.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.tile2.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.tile2.getW(),h.tile2.getH(),1,1,0); } if(cam.loopState==1||cam.loopState==2){ batch.draw(h.tile2.getTextureRegion(), mapW_px+h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.tile2.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.tile2.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.tile2.getW(),h.tile2.getH(),1,1,0); } } if(h.tile1!=null){ if(cam.loopState==0||cam.loopState==1){ batch.draw(h.tile1.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.tile1.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.tile1.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.tile1.getW(),h.tile1.getH(),1,1,0); } if(cam.loopState==1||cam.loopState==2){ batch.draw(h.tile1.getTextureRegion(), h.source_x+mapW_px+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.tile1.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.tile1.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.tile1.getW(),h.tile1.getH(),1,1,0); } } } //Gdx.app.log("updColor","id:"+id+" legion:"+(Integer) regionColors.get(mapBinDAO.getMapbin().get(id).getPolitical())); } } } if(cam.rescource.ifDrawArmyMark&&smapDao.getGame().gameConfig.ifEffect){ i = 0; j = 0;; for (; j<jMax; j++) { for (i = 0; i < iMax; i++) { x = cam.csx + i; if (smapDao.ifLoop && x > smapDao.masterData.getWidth()) { x = x - smapDao.masterData.getWidth(); } y = cam.csy + j; id = x - 1 + (y - 1) * smapDao.masterData.getWidth(); if (id >= 0 && id < smapDao.hexagonDatas.size) { Fb2Smap.HexagonData h = smapDao.hexagonDatas.get(id); if (h.getBlockType()==1&&h.getRegionLegionIndex()!=0&&!h.ifSeaLand) { if (h.getRegionId() != -1) { color=smapDao.getColorForRegion(h.getHexagonIndex()); } else { color = Color.CLEAR; } // batch.setColor(color); batch.setColor(color.r,color.g,color.b,color.a*1.5f); if(h.getBuildData().ifDrawWarLine()){ if(cam.loopState==0||cam.loopState==1){ batch.draw(cam.rescource.hexagonDAO1.getTextureRegion(), h.source_x-cam.rescource.hexagonDAO1.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y-cam.rescource.hexagonDAO1.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,cam.rescource.hexagonDAO1.getW(),cam.rescource.hexagonDAO1.getH(),1,1,0); } if(cam.loopState==1||cam.loopState==2){ batch.draw(cam.rescource.hexagonDAO1.getTextureRegion(), mapW_px+h.source_x-cam.rescource.hexagonDAO1.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y-cam.rescource.hexagonDAO1.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,cam.rescource.hexagonDAO1.getW(),cam.rescource.hexagonDAO1.getH(),1,1,0); } }else{ if(cam.loopState==0||cam.loopState==1){ batch.draw(cam.rescource.hexagonDAO.getTextureRegion(), h.source_x-cam.rescource.hexagonDAO.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y-cam.rescource.hexagonDAO.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,cam.rescource.hexagonDAO.getW(),cam.rescource.hexagonDAO.getH(),1,1,0); } if(cam.loopState==1||cam.loopState==2){ batch.draw(cam.rescource.hexagonDAO.getTextureRegion(), mapW_px+h.source_x-cam.rescource.hexagonDAO.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y-cam.rescource.hexagonDAO.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,cam.rescource.hexagonDAO.getW(),cam.rescource.hexagonDAO.getH(),1,1,0); } } } } } } } int borderId; i = 0; j = 0;; for (; j<jMax; j++) { for (i=0;i<iMax; i++) { x=cam.csx+i; if(smapDao.ifLoop&&x>smapDao.masterData.getWidth()){ x=x-smapDao.masterData.getWidth(); } y=cam.csy+j; id=x-1+(y-1)*smapDao.masterData.getWidth(); if ( id>=0&&id<smapDao.hexagonDatas.size ) { Fb2Smap.HexagonData h=smapDao.hexagonDatas.get(id); if(cam.rescource.ifDrawArmyMark&&smapDao.getGame().gameConfig.ifEffect){ /*if(h.getHexagonIndex()==19918){ int s=0; }*/ if(h.regionLineBorderTile!=null){ if (h.getRegionId() != -1&&smapDao.getLegionIndexByRegion(h.getRegionId())!=0) { color=smapDao.getOppositeColorForRegion(h.getHexagonIndex(),false,defaultColor); batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } if(cam.loopState==0||cam.loopState==1){ batch.draw(h.regionLineBorderTile.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.regionLineBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.regionLineBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.regionLineBorderTile.getW(),h.regionLineBorderTile.getH(),1,1,0); } if(cam.loopState==1||cam.loopState==2){ batch.draw(h.regionLineBorderTile.getTextureRegion(), mapW_px+h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.regionLineBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.regionLineBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.regionLineBorderTile.getW(),h.regionLineBorderTile.getH(),1,1,0); } } if(h.countryBorder!=0){ if(cam.loopState==0||cam.loopState==1){ if (h.getRegionId() != -1&&!h.ifSeaLand) { color=smapDao.getOppositeColorForRegion(h.getHexagonIndex(),false,defaultColor); batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } if(h.countryInnerBorderTile!=null){ batch.draw(h.countryInnerBorderTile.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.countryInnerBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.countryInnerBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.countryInnerBorderTile.getW(),h.countryInnerBorderTile.getH(),1,1,0); } if(h.ifMoreCountryBorder){ int borderId1=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 1); int borderId2=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 2); int borderId3=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 3); int borderId4=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 4); int borderId5=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 5); int borderId6=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 6); Fb2Smap.HexagonData hb1=smapDao.getHexagonData(borderId1); Fb2Smap.HexagonData hb2=smapDao.getHexagonData(borderId2); Fb2Smap.HexagonData hb3=smapDao.getHexagonData(borderId3); Fb2Smap.HexagonData hb4=smapDao.getHexagonData(borderId4); Fb2Smap.HexagonData hb5=smapDao.getHexagonData(borderId5); Fb2Smap.HexagonData hb6=smapDao.getHexagonData(borderId6); int li1=hb1.getRegionLegionIndex(); int li2=hb2.getRegionLegionIndex(); int li3=hb3.getRegionLegionIndex(); int li4=hb4.getRegionLegionIndex(); int li5=hb5.getRegionLegionIndex(); int li6=hb6.getRegionLegionIndex(); if (h.countryBorder1) {//1↗ 2→ 3↘ 4↙ 5← 6↖ //borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 2); //Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb2!=null&&hb3!=null&&((li2==li3)||(!hb2.ifMoreCountryBorder&&!hb3.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb2.ifSeaLand) { color=smapDao.getOppositeColorForRegion(borderId2,false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO11.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO11.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO11.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO11.getW(), cam.rescource.countryBorderDAO11.getH(), 1, 1, 0); } } if (h.countryBorder2) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 3); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb6!=null&&hb3!=null&&((li6==li3)||(!hb6.ifMoreCountryBorder&&!hb3.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb3.ifSeaLand) { color=smapDao.getOppositeColorForRegion(borderId3,false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO12.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO12.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO12.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO12.getW(), cam.rescource.countryBorderDAO12.getH(), 1, 1, 0); } } if (h.countryBorder3) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 6); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb5!=null&&hb6!=null&&((li5==li6)||(!hb5.ifMoreCountryBorder&&!hb6.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb6.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId6, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO13.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO13.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO13.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO13.getW(), cam.rescource.countryBorderDAO13.getH(), 1, 1, 0); } } if (h.countryBorder4) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 5); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb4!=null&&hb5!=null&&((li4==li5)||(!hb4.ifMoreCountryBorder&&!hb5.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb5.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId5, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO14.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO14.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO14.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO14.getW(), cam.rescource.countryBorderDAO14.getH(), 1, 1, 0); } } if (h.countryBorder5) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 4); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb1!=null&&hb4!=null&&((li1==li4)||(!hb1.ifMoreCountryBorder&&!hb4.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb4.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId4, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO15.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO15.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO15.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO15.getW(), cam.rescource.countryBorderDAO15.getH(), 1, 1, 0); } } if (h.countryBorder6) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 1); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb1!=null&&hb2!=null&&((li1==li2)||(!hb1.ifMoreCountryBorder&&!hb2.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb1.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId1, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO16.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO16.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO16.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO16.getW(), cam.rescource.countryBorderDAO16.getH(), 1, 1, 0); } } }else{ /* if(h.getHexagonIndex()==6616){ int s=0; }*/ if (h.getRegionId() != -1) { color=h.getOuterColor(defaultColor); // color=smapDao.getOppositeColorForRegion(h.getHexagonIndex(),false,defaultColor); batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } if(h.countryOuterBorderTile!=null){ batch.draw(h.countryOuterBorderTile.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.countryOuterBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.countryOuterBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.countryOuterBorderTile.getW(),h.countryOuterBorderTile.getH(),1,1,0); } } /**/ } if(cam.loopState==1||cam.loopState==2){ if (h.getRegionId() != -1&&!h.ifSeaLand) { color=smapDao.getOppositeColorForRegion(h.getHexagonIndex(),false,defaultColor); batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } if(h.countryInnerBorderTile!=null){ batch.draw(h.countryInnerBorderTile.getTextureRegion(), mapW_px+h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.countryInnerBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.countryInnerBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.countryInnerBorderTile.getW(),h.countryInnerBorderTile.getH(),1,1,0); } if(h.ifMoreCountryBorder){ int borderId1=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 1); int borderId2=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 2); int borderId3=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 3); int borderId4=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 4); int borderId5=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 5); int borderId6=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 6); Fb2Smap.HexagonData hb1=smapDao.getHexagonData(borderId1); Fb2Smap.HexagonData hb2=smapDao.getHexagonData(borderId2); Fb2Smap.HexagonData hb3=smapDao.getHexagonData(borderId3); Fb2Smap.HexagonData hb4=smapDao.getHexagonData(borderId4); Fb2Smap.HexagonData hb5=smapDao.getHexagonData(borderId5); Fb2Smap.HexagonData hb6=smapDao.getHexagonData(borderId6); int li1=hb1.getRegionLegionIndex(); int li2=hb2.getRegionLegionIndex(); int li3=hb3.getRegionLegionIndex(); int li4=hb4.getRegionLegionIndex(); int li5=hb5.getRegionLegionIndex(); int li6=hb6.getRegionLegionIndex(); if (h.countryBorder1) {//1↗ 2→ 3↘ 4↙ 5← 6↖ //borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 2); //Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb2!=null&&hb3!=null&&((li2==li3)||(!hb2.ifMoreCountryBorder&&!hb3.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb2.ifSeaLand) { color=smapDao.getOppositeColorForRegion(borderId2,false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO11.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO11.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO11.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO11.getW(), cam.rescource.countryBorderDAO11.getH(), 1, 1, 0); } } if (h.countryBorder2) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 3); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb6!=null&&hb3!=null&&((li6==li3)||(!hb6.ifMoreCountryBorder&&!hb3.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb3.ifSeaLand) { color=smapDao.getOppositeColorForRegion(borderId3,false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO12.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO12.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO12.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO12.getW(), cam.rescource.countryBorderDAO12.getH(), 1, 1, 0); } } if (h.countryBorder3) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 6); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb5!=null&&hb6!=null&&((li5==li6)||(!hb5.ifMoreCountryBorder&&!hb6.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb6.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId6, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO13.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO13.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO13.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO13.getW(), cam.rescource.countryBorderDAO13.getH(), 1, 1, 0); } } if (h.countryBorder4) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 5); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb4!=null&&hb5!=null&&((li4==li5)||(!hb4.ifMoreCountryBorder&&!hb5.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb5.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId5, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO14.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO14.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO14.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO14.getW(), cam.rescource.countryBorderDAO14.getH(), 1, 1, 0); } } if (h.countryBorder5) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 4); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb1!=null&&hb4!=null&&((li1==li4)||(!hb1.ifMoreCountryBorder&&!hb4.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb4.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId4, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO15.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO15.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO15.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO15.getW(), cam.rescource.countryBorderDAO15.getH(), 1, 1, 0); } } if (h.countryBorder6) {//1↗ 2→ 3↘ 4↙ 5← 6↖ // borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 1); // Fb2Smap.HexagonData hb=smapDao.getHexagonData(borderId); if(hb1!=null&&hb2!=null&&((li1==li2)||(!hb1.ifMoreCountryBorder&&!hb2.ifMoreCountryBorder)) ){ if (h.getRegionId() != -1&&!hb1.ifSeaLand) { color = smapDao.getOppositeColorForRegion(borderId1, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } batch.draw(cam.rescource.countryBorderDAO16.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO16.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO16.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO16.getW(), cam.rescource.countryBorderDAO16.getH(), 1, 1, 0); } } }else{ /*if(h.getHexagonIndex()==6616){ int s=0; }*/ if (h.getRegionId() != -1) { color=h.getOuterColor(defaultColor); batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } if(h.countryOuterBorderTile!=null){ batch.draw(h.countryOuterBorderTile.getTextureRegion(), mapW_px+h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.countryOuterBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.countryOuterBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.countryOuterBorderTile.getW(),h.countryOuterBorderTile.getH(),1,1,0); } } } /* if (h.countryBorder1) { borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 2); if (h.getRegionId() != -1&&!smapDao.ifSeaLand(borderId)) { color=smapDao.getOppositeColorForRegion(smapDao.getBorderIdByDirect(h.getHexagonIndex(),2),false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } if(cam.loopState==0||cam.loopState==1) { batch.draw(cam.rescource.countryBorderDAO11.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO11.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO11.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO11.getW(), cam.rescource.countryBorderDAO11.getH(), 1, 1, 0); } if(cam.loopState==2||cam.loopState==1) { batch.draw(cam.rescource.countryBorderDAO11.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO11.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO11.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO11.getW(), cam.rescource.countryBorderDAO11.getH(), 1, 1, 0); } } if (h.countryBorder2) { borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 3); if (h.getRegionId() != -1&&!smapDao.ifSeaLand( smapDao.getBorderIdByDirect(h.getHexagonIndex(), 3))) { color=smapDao.getOppositeColorForRegion(smapDao.getBorderIdByDirect(h.getHexagonIndex(),3),false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r,color.g,color.b,1); } else { batch.setColor(defaultColor); } if(cam.loopState==0||cam.loopState==1) { batch.draw(cam.rescource.countryBorderDAO12.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO12.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO12.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO12.getW(), cam.rescource.countryBorderDAO12.getH(), 1, 1, 0); } if(cam.loopState==2||cam.loopState==1) { batch.draw(cam.rescource.countryBorderDAO12.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO12.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO12.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO12.getW(), cam.rescource.countryBorderDAO12.getH(), 1, 1, 0); } } if (h.countryBorder3) { borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 6); if (h.getRegionId() != -1&&!smapDao.ifSeaLand( borderId)) { color = smapDao.getOppositeColorForRegion(borderId, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } if (cam.loopState == 0 || cam.loopState == 1) { batch.draw(cam.rescource.countryBorderDAO13.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO13.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO13.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO13.getW(), cam.rescource.countryBorderDAO13.getH(), 1, 1, 0); } if (cam.loopState == 2 || cam.loopState == 1) { batch.draw(cam.rescource.countryBorderDAO13.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO13.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO13.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO13.getW(), cam.rescource.countryBorderDAO13.getH(), 1, 1, 0); } } if (h.countryBorder4) { borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 5); if (h.getRegionId() != -1&&!smapDao.ifSeaLand( borderId)) { color = smapDao.getOppositeColorForRegion(borderId, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } if (cam.loopState == 0 || cam.loopState == 1) { batch.draw(cam.rescource.countryBorderDAO14.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO14.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO14.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO14.getW(), cam.rescource.countryBorderDAO14.getH(), 1, 1, 0); } if (cam.loopState == 2 || cam.loopState == 1) { batch.draw(cam.rescource.countryBorderDAO14.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO14.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO14.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO14.getW(), cam.rescource.countryBorderDAO14.getH(), 1, 1, 0); } } if (h.countryBorder5) { borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 4); if (h.getRegionId() != -1&&!smapDao.ifSeaLand( borderId)) { color = smapDao.getOppositeColorForRegion(borderId, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } if (cam.loopState == 0 || cam.loopState == 1) { batch.draw(cam.rescource.countryBorderDAO15.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO15.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO15.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO15.getW(), cam.rescource.countryBorderDAO15.getH(), 1, 1, 0); } if (cam.loopState == 2 || cam.loopState == 1) { batch.draw(cam.rescource.countryBorderDAO15.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO15.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO15.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO15.getW(), cam.rescource.countryBorderDAO15.getH(), 1, 1, 0); } } if (h.countryBorder6) { borderId=smapDao.getBorderIdByDirect(h.getHexagonIndex(), 1); if (h.getRegionId() != -1&&!smapDao.ifSeaLand( borderId)) { color = smapDao.getOppositeColorForRegion(borderId, false,defaultColor);//1↖ 2上 3↗ 4↙ 5↓ 6↘ batch.setColor(color.r, color.g, color.b, 1); } else { batch.setColor(defaultColor); } if (cam.loopState == 0 || cam.loopState == 1) { batch.draw(cam.rescource.countryBorderDAO16.getTextureRegion(), h.source_x - cam.rescource.countryBorderDAO16.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO16.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO16.getW(), cam.rescource.countryBorderDAO16.getH(), 1, 1, 0); } if (cam.loopState == 2 || cam.loopState == 1) { batch.draw(cam.rescource.countryBorderDAO16.getTextureRegion(), mapW_px+h.source_x - cam.rescource.countryBorderDAO16.getRefx() * ResDefaultConfig.Map.MAP_SCALE, h.source_y - cam.rescource.countryBorderDAO16.getRefy() * ResDefaultConfig.Map.MAP_SCALE , 0, 0, cam.rescource.countryBorderDAO16.getW(), cam.rescource.countryBorderDAO16.getH(), 1, 1, 0); } } /**/ } }else { if(h.countryLineBorderTile!=null){ if(cam.loopState==0||cam.loopState==1){ batch.draw(h.countryLineBorderTile.getTextureRegion(), h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.countryLineBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.countryLineBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.countryLineBorderTile.getW(),h.countryLineBorderTile.getH(),1,1,0); } if(cam.loopState==1||cam.loopState==2){ batch.draw(h.countryLineBorderTile.getTextureRegion(), mapW_px+h.source_x+h.getBackRefX()* ResDefaultConfig.Map.MAP_SCALE-h.countryLineBorderTile.getRefx()* ResDefaultConfig.Map.MAP_SCALE, h.source_y+h.getBackRefY()* ResDefaultConfig.Map.MAP_SCALE-h.countryLineBorderTile.getRefy()* ResDefaultConfig.Map.MAP_SCALE ,0,0,h.countryLineBorderTile.getW(),h.countryLineBorderTile.getH(),1,1,0); } } } //Gdx.app.log("updColor","id:"+id+" legion:"+(Integer) regionColors.get(mapBinDAO.getMapbin().get(id).getPolitical())); } } } // Gdx.app.log("setColor1","end"); } }
public void updVirAttribute(){ countryBorder1=ifCountryBorderX(getHexagonIndex(),1);//1↗ 2→ 3↘ 4↙ 5← 6↖ countryBorder2=ifCountryBorderX(getHexagonIndex(),2); countryBorder3=ifCountryBorderX(getHexagonIndex(),3); countryBorder4=ifCountryBorderX(getHexagonIndex(),4); countryBorder5=ifCountryBorderX(getHexagonIndex(),5); countryBorder6=ifCountryBorderX(getHexagonIndex(),6); countryBorder =GameMethod.getFBorderId(countryBorder1,countryBorder2,countryBorder3,countryBorder4,countryBorder5,countryBorder6); regionLineBorderTile=game.getImgLists().getTextureByName( DefDAO.getLineBorder((countryBorder5||countryBorder6||ifCountryBorderX(getBorderIdByDirect(getHexagonIndex(),1),2))?false:ifRegionBorder(getHexagonIndex(),1,true),(countryBorder1||countryBorder6||ifCountryBorderX(getBorderIdByDirect(getHexagonIndex(),2),3)||ifCountryBorderX(getBorderIdByDirect(getHexagonIndex(),2),4))?false:ifRegionBorder(getHexagonIndex(),2,true),(countryBorder1||countryBorder2||ifCountryBorderX(getBorderIdByDirect(getHexagonIndex(),3),4))?false:ifRegionBorder(getHexagonIndex(),3,true))); // regionLineBorderTile=game.getImgLists().getTextureByName(DefDAO.getLineBorder(ifRegionBorder(getHexagonIndex(),1,false),ifRegionBorder(getHexagonIndex(),2,false),ifRegionBorder(getHexagonIndex(),3,false))); countryLineBorderTile=game.getImgLists().getTextureByName(DefDAO.getLineBorder(ifCountryBorder(getHexagonIndex(),1,true),ifCountryBorder(getHexagonIndex(),2,true),ifCountryBorder(getHexagonIndex(),3,true))); ifMoreCountryBorder=ifMoreCountryBorder(); if(countryBorder==0){ countryInnerBorderTile=null; countryOuterBorderTile =null; }else{ countryInnerBorderTile=game.getImgLists().getTextureByName("countryInteralBorder_"+countryBorder); countryOuterBorderTile =game.getImgLists().getTextureByName("countryExternalBorder_"+countryBorder); } }