optimisation renderer
suppretion de nombre magique changement fond supression classe inutile
This commit is contained in:
@@ -57,6 +57,8 @@ public class GameLogicThread extends Thread{
|
||||
renderer.moveToDraw(40,20,"card3");
|
||||
break;
|
||||
}
|
||||
((DrawableCard)renderer.getDrawAble("card3")).setOnBoard(false);
|
||||
renderer.updateFrame();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,6 +67,9 @@ public class GameLogicThread extends Thread{
|
||||
* TOUT CALCUL REDONDANT CE DOIT D'AVOIR ETE PRE FAIT
|
||||
*
|
||||
* TOUT APELLE DE CETTE FONCTION SE DOIT D'ÊTRE PROTEGER PAR isReady()
|
||||
*
|
||||
* /!\ renderer.updateFrame(); va forcer le system a redessiner l'afficher qui ensuite reappelera onFrameDoneRendering() ce qui peut causer si le updateFrame() n'est pas proteger
|
||||
* une utilisation de la batterie massivz
|
||||
*/
|
||||
public void onFrameDoneRendering()
|
||||
{
|
||||
@@ -79,7 +84,8 @@ public class GameLogicThread extends Thread{
|
||||
}
|
||||
if(i==0)increm=-increm;
|
||||
|
||||
((DrawableCard)renderer.getDrawAble("card3")).setOnBoard(false);
|
||||
|
||||
//
|
||||
//TODO get x,y coordinate form name
|
||||
//r.moveToDraw(i,i,"card2");
|
||||
//renderer.moveToDraw(i,i,"card3");
|
||||
|
||||
@@ -39,6 +39,7 @@ public class TouchHandler {
|
||||
deltaX = 0;
|
||||
} else if (moveEventCard != null) {
|
||||
moveEventCard.setCoordinates(unscalled_X - deltaX, unscalled_Y - deltaY);
|
||||
renderer.updateFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.iutlaval.myapplication.ERROR_CODE;
|
||||
import com.iutlaval.myapplication.GameActivity;
|
||||
import com.iutlaval.myapplication.InvalidDataException;
|
||||
import com.iutlaval.myapplication.Video.Rectangle;
|
||||
import com.iutlaval.myapplication.Video.Renderer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -77,6 +76,7 @@ public class Drawable {
|
||||
|
||||
checkPaint();
|
||||
p.setColor(Color.BLACK);
|
||||
p.setAntiAlias(true);
|
||||
|
||||
|
||||
|
||||
@@ -188,9 +188,10 @@ public class Drawable {
|
||||
/**
|
||||
* permet de changer les coordonnés sur l'ecran de l'objet
|
||||
* TOUT LES OBJET SONT DESSINER DEPUIS LE COIN HAUT GAUCHE LES COODONNE DESIGNE DONC CE COIN
|
||||
* ET NON PAS LE CENTRE DE LA CARTE
|
||||
* ET NON PAS LE CENTRE DE L'OBJET
|
||||
* @param x
|
||||
* @param y
|
||||
* /!\ PENSER A APPELER renderer.updateFrame(); AFFIN D'AFFICHER LE CHANGEMENT /!\
|
||||
*/
|
||||
public void setCoordinates(float x, float y) {
|
||||
this.x=x;
|
||||
|
||||
@@ -13,14 +13,68 @@ import com.iutlaval.myapplication.Game.Cards.Card;
|
||||
import com.iutlaval.myapplication.InvalidDataException;
|
||||
import com.iutlaval.myapplication.Video.Rectangle;
|
||||
|
||||
/**
|
||||
* TOUT LES NUMEROS QUI NE SONT PAS DANS DES FINAL SONT DES RATIO PERMETTANT DE METTRE TOUT A L ECHCELLE
|
||||
* TODO : tout mettre dans des finals
|
||||
*/
|
||||
public class DrawableCard extends Drawable{
|
||||
|
||||
private static final int CARD_WITH = 14;
|
||||
private static final int CARD_HEIGHT = 32;
|
||||
private static final int CARD_HEIGHT = 40;
|
||||
private static final float HP_ATK_FONT_SIZE_BIG_CARD =30F;
|
||||
private static final float HP_ATK_FONT_SIZE_BOARD =70F;
|
||||
private static final float DESCRIPTION_FONT_SIZE =30F;
|
||||
private static final float TITLE_FONT_SIZE =30F;
|
||||
private static int DESCRIPTION_TEXT_X_RES = 281;
|
||||
private static int DESCRIPTION_TEXT_Y_RES = 195;
|
||||
|
||||
|
||||
//des floats sont utiliser card ils prenne moin de ram que des doubles et que l'on a pas besoin de la precision supplementaire
|
||||
//dimentions
|
||||
private static final float ONBOARD_RECTANGLE_ATK_HP_WIDTH = CARD_WITH * 0.5F;
|
||||
private static final float ONBOARD_RECTANGLE_ATK_HP_HEIGHT = CARD_HEIGHT * 0.2F;
|
||||
private static final float ONBOARD_ATK_HP_WIDTH = 0.4F * CARD_WITH;
|
||||
private static final float ONBOARD_ATK_HP_HEIGHT = 0.125F * CARD_HEIGHT;
|
||||
private static final float OFFBOARD_ATK_HP_WIDTH = 0.5F * CARD_WITH;
|
||||
private static final float OFFBOARD_ATK_HP_HEIGHT = 0.2F * CARD_HEIGHT;
|
||||
|
||||
private static final float DESCRIPTION_WIDTH = CARD_WITH*0.9F;
|
||||
private static final float DESCRIPTION_HEIGHT = CARD_HEIGHT*0.35F;
|
||||
private static final float TITLE_HEIGHT = CARD_HEIGHT*0.1F;
|
||||
private static final float TITLE_WIDTH = CARD_WITH;
|
||||
private static final float OPACITY_RECT_WIDTH=CARD_WITH;
|
||||
private static final float OPACITY_RECT_HEIGHT=CARD_HEIGHT;
|
||||
private static final float PICTURE_WIDTH = CARD_WITH * 0.834F;
|
||||
private static final float PICTURE_HEIGHT = CARD_HEIGHT * 0.37F;
|
||||
|
||||
//variables de posisions
|
||||
private final float ONBOARD_PICTURE_X = 0.0714F * CARD_WITH;
|
||||
private final float ONBOARD_PICTURE_Y = 0.0625F * CARD_HEIGHT;
|
||||
private final float ONBOARD_ATK_X = 0.05F * CARD_WITH;
|
||||
private final float ONBOARD_ATK_HP_Y = 0.52F * CARD_HEIGHT;
|
||||
private final float ONBOARD_HP_X = 0.55F * CARD_WITH;
|
||||
private final float ONBOARD_TITLE_X = 0.1F * CARD_WITH;
|
||||
private final float ONBOARD_TITLE_Y = 0.05F * CARD_HEIGHT;
|
||||
|
||||
private static final float ONBOARD_FRAME_X_SIZE = CARD_WITH;
|
||||
private static final float ONBOARD_FRAME_Y_SIZE = CARD_HEIGHT*0.5F;
|
||||
private static final float ONBOARD_RECTANGLE_ATK_HP_Y = CARD_HEIGHT * 0.385F;
|
||||
private static final float ONBOARD_RECTANGLE_ATK_X = CARD_HEIGHT * 0F;
|
||||
private static final float ONBOARD_RECTANGLE_HP_X = CARD_WITH * 0.5F;
|
||||
|
||||
private final float OFFBOARD_PICTURE_X = 0.0787F * CARD_WITH;
|
||||
private final float OFFBOARD_PICTURE_Y = 0.0834F * CARD_HEIGHT;
|
||||
private final float OFFBOARD_DESCRIPTION_X = 0.07F * CARD_WITH;
|
||||
private final float OFFBOARD_DESCRIPTION_Y = 0.455F * CARD_HEIGHT;
|
||||
private final float OFFBOARD_ATK_X = 0.08F * CARD_WITH;
|
||||
private final float OFFBOARD_ATK_Y = 0.735F * CARD_HEIGHT;
|
||||
private final float OFFBOARD_HP_X = 0.7F * CARD_WITH;
|
||||
private final float OFFBOARD_HP_Y = 0.735F * CARD_HEIGHT;
|
||||
private final float OFFBOARD_TITLE_X =0.1F * CARD_WITH;
|
||||
private final float OFFBOARD_TITLE_Y = 0.025F * CARD_HEIGHT;
|
||||
|
||||
private static final float CARD_ON_BOARD_DRAWABLE_WIDTH = CARD_WITH;
|
||||
private static final float CARD_ON_BOARD_DRAWABLE_HEIGHT = CARD_HEIGHT*0.667F;
|
||||
|
||||
private Boolean onBoard;
|
||||
|
||||
@@ -65,15 +119,16 @@ public class DrawableCard extends Drawable{
|
||||
|
||||
onBoard=true;
|
||||
|
||||
cardDescription = new DrawableCardDescription(c.getDescription(),x+CARD_WITH*0.07F,y+CARD_HEIGHT/2.2F,toString()+"description",CARD_WITH*0.9F,CARD_HEIGHT*0.35F,DESCRIPTION_FONT_SIZE);
|
||||
cardTitle = new DrawableCardTitle(c.getName(),0,0,toString()+"name",CARD_WITH,CARD_HEIGHT*0.1F,TITLE_FONT_SIZE);
|
||||
//to string retourne le hash code de l'objet qui est donc unique ce qui fait de lui un id parfait
|
||||
cardDescription = new Drawable(c.getDescription(),0,0,toString()+"description",DESCRIPTION_WIDTH,DESCRIPTION_HEIGHT,DESCRIPTION_FONT_SIZE,DESCRIPTION_TEXT_X_RES,DESCRIPTION_TEXT_Y_RES);
|
||||
cardTitle = new DrawableCardTitle(c.getName(),0,0,toString()+"name",TITLE_WIDTH,TITLE_HEIGHT,TITLE_FONT_SIZE);
|
||||
|
||||
Rectangle cardRect = new Rectangle(x,y,CARD_WITH+x,CARD_HEIGHT+x);
|
||||
Rectangle opacityRect = new Rectangle(x,y,OPACITY_RECT_WIDTH+x,OPACITY_RECT_HEIGHT+x);
|
||||
Bitmap pictureBitmap = BitmapFactory.decodeResource(context.getResources(),c.getCardPicture());
|
||||
|
||||
try {
|
||||
OpacityRectangleDrawable = new Drawable(cardRect,toString()+"Opacity", Color.parseColor(c.getColor()));
|
||||
PictureDrawable = new Drawable(pictureBitmap,0,0,toString()+"Picture",CARD_WITH/1.2F,CARD_HEIGHT/2.7F);
|
||||
OpacityRectangleDrawable = new Drawable(opacityRect,toString()+"Opacity", Color.parseColor(c.getColor()));
|
||||
PictureDrawable = new Drawable(pictureBitmap,0,0,toString()+"Picture",PICTURE_WIDTH,PICTURE_HEIGHT);
|
||||
} catch (InvalidDataException e) {
|
||||
e.printStackTrace();
|
||||
Log.e("CARTE :","forme de la carte invalide !");
|
||||
@@ -81,17 +136,15 @@ public class DrawableCard extends Drawable{
|
||||
}
|
||||
|
||||
|
||||
Paint p = new Paint();
|
||||
|
||||
//TODO optimize rectangle by making it only one time
|
||||
//crée les rectangle pour la carte quand elle est sur le terrain
|
||||
Rectangle cardOnBoardFrame = new Rectangle(x,y,CARD_WITH,CARD_HEIGHT/2);
|
||||
Rectangle cardOnBoardFrame = new Rectangle(x,y,ONBOARD_FRAME_X_SIZE,ONBOARD_FRAME_Y_SIZE);
|
||||
cardOnBoardFrame.scaleRectangleToScreen();
|
||||
|
||||
float offset = CARD_HEIGHT/2.7F;
|
||||
Rectangle cardOnBoardAtk = new Rectangle(x,offset,CARD_WITH/2,CARD_HEIGHT/8);
|
||||
Rectangle cardOnBoardAtk = new Rectangle(x + ONBOARD_RECTANGLE_ATK_X, ONBOARD_RECTANGLE_ATK_HP_Y,ONBOARD_RECTANGLE_ATK_HP_WIDTH,ONBOARD_RECTANGLE_ATK_HP_HEIGHT);
|
||||
cardOnBoardAtk.scaleRectangleToScreen();
|
||||
Rectangle cardOnBoardHp = new Rectangle(CARD_WITH/2,offset,CARD_WITH/2,CARD_HEIGHT/8);
|
||||
Rectangle cardOnBoardHp = new Rectangle(x + ONBOARD_RECTANGLE_HP_X, ONBOARD_RECTANGLE_ATK_HP_Y,ONBOARD_RECTANGLE_ATK_HP_WIDTH,ONBOARD_RECTANGLE_ATK_HP_HEIGHT);
|
||||
cardOnBoardHp.scaleRectangleToScreen();
|
||||
|
||||
//creation de la bitmap qui va être rendu
|
||||
@@ -102,7 +155,7 @@ public class DrawableCard extends Drawable{
|
||||
cardOnBoardAtk.bitmapRectangleBuilder(cardOnBoardBitmap,Color.parseColor("#FFFF0000"));
|
||||
cardOnBoardHp.bitmapRectangleBuilder(cardOnBoardBitmap,Color.parseColor("#FF00FF00"));
|
||||
|
||||
cardOnBoardDrawable = new Drawable(cardOnBoardBitmap,x,y,toString()+"BOARD",CARD_WITH,CARD_HEIGHT*2/3);
|
||||
cardOnBoardDrawable = new Drawable(cardOnBoardBitmap,x,y,toString()+"BOARD",CARD_ON_BOARD_DRAWABLE_WIDTH,CARD_ON_BOARD_DRAWABLE_HEIGHT);
|
||||
|
||||
c.setDrawableCard(this);
|
||||
|
||||
@@ -110,6 +163,8 @@ public class DrawableCard extends Drawable{
|
||||
setCoordinates(getX(), getY());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* cette fonction permet de mettre a jour le nombre de hp restant
|
||||
* si vous ne voulez pas changer une des donnes metter la null ce n'est pas des int mais des Integer donc c'est possible
|
||||
@@ -123,18 +178,21 @@ public class DrawableCard extends Drawable{
|
||||
{
|
||||
if(onBoard) {
|
||||
if (atk != null)
|
||||
cardAtkDrawable = new DrawableHpAtk(atk+"", 0, 0, toString() + "atk", CARD_WITH * 0.4F, CARD_HEIGHT / 8, HP_ATK_FONT_SIZE_BOARD);
|
||||
cardAtkDrawable = new DrawableHpAtk(atk+"", 0, 0, toString() + "atk", ONBOARD_ATK_HP_WIDTH, ONBOARD_ATK_HP_HEIGHT, HP_ATK_FONT_SIZE_BOARD);
|
||||
if (hp != null)
|
||||
cardHpDrawable = new DrawableHpAtk(hp+"", 0, 0, toString() + "hp", CARD_WITH * 0.4F, CARD_HEIGHT / 8, HP_ATK_FONT_SIZE_BOARD);
|
||||
cardHpDrawable = new DrawableHpAtk(hp+"", 0, 0, toString() + "hp", ONBOARD_ATK_HP_WIDTH, ONBOARD_ATK_HP_HEIGHT, HP_ATK_FONT_SIZE_BOARD);
|
||||
}else{
|
||||
if (atk != null)
|
||||
cardAtkDrawable = new DrawableHpAtk(atk + "", 0, 0, toString() + "atk", CARD_WITH / 2, CARD_HEIGHT / 4, HP_ATK_FONT_SIZE_BIG_CARD);
|
||||
cardAtkDrawable = new DrawableHpAtk(atk + "", 0, 0, toString() + "atk", OFFBOARD_ATK_HP_WIDTH, OFFBOARD_ATK_HP_HEIGHT, HP_ATK_FONT_SIZE_BIG_CARD);
|
||||
if (hp != null)
|
||||
cardHpDrawable = new DrawableHpAtk(hp + "", 0, 0, toString() + "hp", CARD_WITH / 2, CARD_HEIGHT / 4, HP_ATK_FONT_SIZE_BIG_CARD);
|
||||
cardHpDrawable = new DrawableHpAtk(hp + "", 0, 0, toString() + "hp", OFFBOARD_ATK_HP_WIDTH, OFFBOARD_ATK_HP_HEIGHT, HP_ATK_FONT_SIZE_BIG_CARD);
|
||||
}
|
||||
setCoordinates(getX(), getY());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* supprime la couche alpha numerique d'une carte
|
||||
* MAIS si la carte est completement transparente ALORS la texture devien blanche
|
||||
@@ -182,34 +240,38 @@ public class DrawableCard extends Drawable{
|
||||
|
||||
/**
|
||||
* cette fonction permet de deplacer la carte et tout ces sous element
|
||||
* tout les valeur on ete determiner empiriquement
|
||||
* @param x postion x
|
||||
* @param y postion y
|
||||
* /!\ PENSER A APPELER renderer.updateFrame(); AFFIN D'AFFICHER LE CHANGEMENT /!\
|
||||
*/
|
||||
@Override
|
||||
public void setCoordinates(float x, float y) {
|
||||
super.setCoordinates(x, y);
|
||||
if (onBoard) {
|
||||
cardOnBoardDrawable.setCoordinates(x,y);
|
||||
PictureDrawable.setCoordinates(x + CARD_WITH/14F, y +CARD_HEIGHT/16F);
|
||||
cardAtkDrawable.setCoordinates(x+CARD_WITH*0.05F,y + CARD_HEIGHT*0.48F );
|
||||
cardHpDrawable.setCoordinates(x+CARD_WITH*0.55F,y + CARD_HEIGHT*0.48F );
|
||||
cardTitle.setCoordinates(x+CARD_WITH*0.1F,y - CARD_WITH * 0.1F);
|
||||
PictureDrawable.setCoordinates(x + ONBOARD_PICTURE_X, y +ONBOARD_PICTURE_Y);
|
||||
cardAtkDrawable.setCoordinates(x+ONBOARD_ATK_X,y + ONBOARD_ATK_HP_Y);
|
||||
cardHpDrawable.setCoordinates(x+ONBOARD_HP_X,y + ONBOARD_ATK_HP_Y);
|
||||
cardTitle.setCoordinates(x+ONBOARD_TITLE_X,y - ONBOARD_TITLE_Y);
|
||||
}else{
|
||||
OpacityRectangleDrawable.setCoordinates(x, y);
|
||||
PictureDrawable.setCoordinates(x + CARD_WITH/12.7F, y + CARD_HEIGHT/12.0F);
|
||||
PictureDrawable.setCoordinates(x + OFFBOARD_PICTURE_X, y + OFFBOARD_PICTURE_Y);
|
||||
|
||||
//les textes ce dessines depuis leur base et non depuis le coin haut gauche
|
||||
cardDescription.setCoordinates(x+CARD_WITH*0.07F,y+CARD_HEIGHT/2.2F);
|
||||
cardAtkDrawable.setCoordinates(x + CARD_WITH*0.08F,y +CARD_HEIGHT*0.70F);
|
||||
cardHpDrawable.setCoordinates(x + CARD_WITH*0.7F,y +CARD_HEIGHT*0.70F);
|
||||
cardTitle.setCoordinates(x+CARD_WITH*0.1F,y - CARD_WITH * 0.055F);
|
||||
cardDescription.setCoordinates(x+OFFBOARD_DESCRIPTION_X,y+OFFBOARD_DESCRIPTION_Y);
|
||||
cardAtkDrawable.setCoordinates(x + OFFBOARD_ATK_X,y + OFFBOARD_ATK_Y);
|
||||
cardHpDrawable.setCoordinates(x + OFFBOARD_HP_X,y +OFFBOARD_HP_Y);
|
||||
cardTitle.setCoordinates(x+OFFBOARD_TITLE_X,y - OFFBOARD_TITLE_Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* defini si la carte doit s'afficher en format plein ecran ou en format terrain (avec ou sans description)
|
||||
* @param onBoard
|
||||
* /!\ PENSER A APPELER renderer.updateFrame(); AFFIN D'AFFICHER LE CHANGEMENT /!\
|
||||
*/
|
||||
public void setOnBoard(Boolean onBoard)
|
||||
{
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package com.iutlaval.myapplication.Video.Drawables;
|
||||
|
||||
public class DrawableCardDescription extends Drawable {
|
||||
private static int TEXT_X_RES = 281;
|
||||
private static int TEXT_Y_RES = 195;
|
||||
|
||||
public DrawableCardDescription(String text, float x_pos, float y_pos, String name, float x_size, float y_size, float textSize) {
|
||||
super(text,x_pos,y_pos,name,x_size,y_size,textSize,TEXT_X_RES,TEXT_Y_RES);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class Renderer extends SurfaceView implements SurfaceHolder.Callback {
|
||||
private Paint p;
|
||||
private DrawingThread drawingThread;
|
||||
private GameLogicThread engine;
|
||||
|
||||
private boolean contentChanged;
|
||||
|
||||
private List<Drawable> toDraw;
|
||||
|
||||
@@ -100,6 +100,15 @@ public class Renderer extends SurfaceView implements SurfaceHolder.Callback {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* le moteur arrete toute forme de rendu si rien ne change MAIS il ne peut pas detecter des changement qui
|
||||
* ne passe pas par la classe Renderer donc si vous modifier un drawable il faut appeler updateFrame() pour
|
||||
* demander au moteur de faire sont travaille
|
||||
*/
|
||||
public void updateFrame() {
|
||||
contentChanged=true;
|
||||
}
|
||||
|
||||
/**
|
||||
* main drawing thread render each frame
|
||||
*/
|
||||
@@ -133,6 +142,15 @@ public class Renderer extends SurfaceView implements SurfaceHolder.Callback {
|
||||
//sauve de la baterie
|
||||
FpsTime.waitFrameTime(time);
|
||||
if(engine != null && engine.isReady())engine.onFrameDoneRendering();
|
||||
while(!contentChanged)
|
||||
{
|
||||
try {
|
||||
Thread.sleep(20);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
contentChanged=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,6 +169,7 @@ public class Renderer extends SurfaceView implements SurfaceHolder.Callback {
|
||||
}
|
||||
}
|
||||
toDraw.add(newElement);
|
||||
contentChanged=true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -166,6 +185,7 @@ public class Renderer extends SurfaceView implements SurfaceHolder.Callback {
|
||||
if(d.getName().equals(name))
|
||||
{
|
||||
d.setCoordinates(x,y);
|
||||
contentChanged=true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -180,6 +200,7 @@ public class Renderer extends SurfaceView implements SurfaceHolder.Callback {
|
||||
Drawable d = getDrawAble(name);
|
||||
if(d != null)
|
||||
toDraw.remove(d);
|
||||
contentChanged=true;
|
||||
}
|
||||
/**
|
||||
* remove the element from the draw list
|
||||
@@ -187,6 +208,7 @@ public class Renderer extends SurfaceView implements SurfaceHolder.Callback {
|
||||
*/
|
||||
public void removeToDraw(Drawable toRemove){
|
||||
toDraw.remove(toRemove);
|
||||
contentChanged=true;
|
||||
}
|
||||
|
||||
|
||||
@@ -228,11 +250,14 @@ public class Renderer extends SurfaceView implements SurfaceHolder.Callback {
|
||||
{
|
||||
if(y >= card.getY() && y <= card.getY()+card.getCardHeight())
|
||||
{
|
||||
//on considére que si on prend la carte c'est pour changer ses valeurs
|
||||
contentChanged=true;
|
||||
return card;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 532 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
@@ -4,6 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#2196F3"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<ImageView
|
||||
@@ -11,19 +12,21 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:alpha="0.7"
|
||||
android:alpha="1"
|
||||
android:rotation="0"
|
||||
android:scaleType="fitStart"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
app:srcCompat="@drawable/t_b_batiut" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/alfa_slab_one"
|
||||
android:text="Info Battlecard"
|
||||
android:textAlignment="center"
|
||||
@@ -33,20 +36,21 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/imageView"
|
||||
app:layout_constraintVertical_bias="0.146" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/playButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:text="Jouer"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/button8"
|
||||
app:layout_constraintEnd_toEndOf="@+id/imageView"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="@+id/imageView"
|
||||
app:layout_constraintTop_toTopOf="@+id/imageView"
|
||||
app:layout_constraintVertical_bias="0.512" />
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button8"
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView5"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/t_b_batiut" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="42dp"
|
||||
android:fontFamily="@font/alfa_slab_one"
|
||||
android:text="Info Battlecard"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#A6FF9800"
|
||||
android:textSize="50sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button2"
|
||||
app:layout_constraintVertical_bias="0.060000002" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/playButton2"
|
||||
style="@android:style/Widget.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:shadowColor="#000000"
|
||||
android:text="Jouer"
|
||||
android:textColor="#000000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.43" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Carte"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/playButton2"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#000000">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:alpha="1"
|
||||
android:rotation="0"
|
||||
android:scaleType="fitStart"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
app:srcCompat="@drawable/t_b_batiut" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/alfa_slab_one"
|
||||
android:text="Info Battlecard"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#A6FF9800"
|
||||
android:textSize="50sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/playButton3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Jouer"
|
||||
app:layout_constraintBottom_toTopOf="@+id/button3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="84dp"
|
||||
android:text="Carte"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/imageView"
|
||||
app:layout_constraintVertical_bias="0.664" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -4,36 +4,9 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#D84747"
|
||||
android:background="#000000"
|
||||
tools:context=".GameActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:fontFamily="@font/alfa_slab_one"
|
||||
android:text="Info Battlecard"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#A6FF9800"
|
||||
android:textSize="50sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView2"
|
||||
app:layout_constraintVertical_bias="0.060000002" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/playButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Jouer"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.559" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="0dp"
|
||||
@@ -49,15 +22,45 @@
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
app:srcCompat="@drawable/t_b_batiut" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/alfa_slab_one"
|
||||
android:text="Info Battlecard"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#A6FF9800"
|
||||
android:textSize="36sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.702" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/playButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Jouer"
|
||||
android:textScaleX="1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.43" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="Carte"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintEnd_toEndOf="@+id/playButton"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.664" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/playButton"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user