AccueilAccueil  FAQFAQ  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  Connexion  
-21%
Le deal à ne pas rater :
LEGO® Icons 10329 Les Plantes Miniatures, Collection Botanique
39.59 € 49.99 €
Voir le deal

 

 draw background "tile hor" "tile vert"

Aller en bas 
2 participants
AuteurMessage
chopsuey
Utilisateur confirmé: Rang ***
chopsuey


Messages : 523
Localisation : saint etienne
Projet Actuel : All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
...

draw background "tile hor" "tile vert" Empty
MessageSujet: draw background "tile hor" "tile vert"   draw background "tile hor" "tile vert" EmptyDim 2 Fév 2014 - 2:38

salut à tous Smile

Est ce que vous savez comment je peu draw un bg tiled mais en choisissant si je veux "tiled" à l'horizontal ou à la vertical.
On peux le faire dans l'éditeur de map en cochant ou décochant "tile hor" ou "tile vert"
Je n'ai trouvé que cette fonction dans la doc draw_background_tiled(back,x,y)
Merci.

_________________
Spoiler:
Revenir en haut Aller en bas
Is Daouda
Utilisateur confirmé: Rang **
Is Daouda


Messages : 392
Localisation : ...

draw background "tile hor" "tile vert" Empty
MessageSujet: Re: draw background "tile hor" "tile vert"   draw background "tile hor" "tile vert" EmptyVen 28 Fév 2014 - 19:46

ce script pourra peut être t'aider

Code:

/*
**  Usage:
**      draw_background_tiled_area(background,x,y,x1,y2,x2,y2)
**
**  Arguments:
**      background  the background to be drawn
**      x,y         the offset of the tiled area, as defined by a point
**                  the background will/would be drawn
**      x1,y1       top left corner of the rectangle defining the area
**      x2,y2       bottom right corner of the area
**
**  Notes:
**      x1 MUST be less than x2, and y1 less than y2
**      (x,y) doesn't have to be in the area, but if it is, then some
**      drawn background will have it's origin at this point
**

** exmple pour déssiné le background:
draw_background_tiled_area(background0,view_xport[0],view_yview[0],view_xview[0]+0,view_yview[0]+0,view_xview[0]+640,view_yview[0]+480)
*/
{
    var bg,xx,yy,x1,y1,x2,y2;
    bg = argument0;
    xx = argument1;
    yy = argument2;
    x1 = argument3;
    y1 = argument4;
    x2 = argument5;
    y2 = argument6;
    
    var bw,bh,i,j,jj,left,top,width,height,X,Y;
    bw = background_get_width(bg);
    bh = background_get_height(bg);
    
    i = x1-((x1 mod bw) - (xx mod bw)) - bw*((x1 mod bw)<(xx mod bw));
    j = y1-((y1 mod bh) - (yy mod bh)) - bh*((y1 mod bh)<(yy mod bh));
   jj = j;
    
    for(i=i; i<=x2; i+=bw) {
        for(j=j; j<=y2; j+=bh) {
        
            if(i <= x1) left = x1-i;
            else left = 0;
            X = i+left;
            
            if(j <= y1) top = y1-j;
            else top = 0;
            Y = j+top;
            
            if(x2 <= i+bw) width = ((bw)-(i+bw-x2)+1)-left;
            else width = bw-left;
            
            if(y2 <= j+bh) height = ((bh)-(j+bh-y2)+1)-top;
            else height = bh-top;
            
            draw_background_part(bg,left,top,width,height,X,Y);
        }
        j = jj;
    }
}

_________________
"Celui qui trouve sans chercher a longtemps cherché sans trouver".
Revenir en haut Aller en bas
chopsuey
Utilisateur confirmé: Rang ***
chopsuey


Messages : 523
Localisation : saint etienne
Projet Actuel : All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
...

draw background "tile hor" "tile vert" Empty
MessageSujet: Re: draw background "tile hor" "tile vert"   draw background "tile hor" "tile vert" EmptySam 1 Mar 2014 - 19:31

merci Wink

_________________
Spoiler:
Revenir en haut Aller en bas
Contenu sponsorisé





draw background "tile hor" "tile vert" Empty
MessageSujet: Re: draw background "tile hor" "tile vert"   draw background "tile hor" "tile vert" Empty

Revenir en haut Aller en bas
 
draw background "tile hor" "tile vert"
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Tile ou background ? [résolu]
» Parallax avec 2 Tile Layer
» Barre de vie rouge/vert
» question Tile
» BAckground

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Forum Le CBNA :: Développement :: Entraide débutants-
Sauter vers: