 setPaintColor() I am changing the color of the paint. But when I change the color, the whole drawing gets changed (even the lines that I drew before). How to change the color of the paint and leave previous drawings untached? I tried to create new Path, but then the previous drawing disappears.

A:

You need to make a small datastructure for this, which will store both color and path of the drawing.. here is an example: 
class PaintClass
{
    Path path;
    int Color;
    public int getColor() { return color; }
    public void setColor(int color){this.Color = color;}
    public int getPath() { return path; }
    public void setPath(Path path){this.path = path;}

   ...
   ...
   ...   
}

Now maintain an arraylist having objects of PaintClass. 
Implement it like this in onDraw method
{    
    for(PaintClass item : yourArrayListOfPaintClassObjects)
    {
        //set Paint color like this
        setPaintColor(item.getPaintColor());
        canvas.drawPath(.....,paint);
    }
}

Note: On each new drawing add newely made PaintClass object in arraylist...

 Q:

no matching function for this function in c++

I'm having trouble with this one. I've read some other pages here but I didn't found a solution for this:
This is my code:
void Tanque::update(World *world, vector<Fantasma*> *ListaFantasmas){

rot = bearing(rect.x, rect.y, ListaFantasmas->back()->rect.x, ListaFantasmas->back()->rect.y);

bala1-> update(&(ListaFantasmas-> back()));
}

the last line gives me an error. (no matchig function for call to bala::update(Fantasma**)
And this is the code for Bala:update:
void bala::update(Fantasma *fantasma){

rect.x = rect.x + speed * cos(rot);
rect.y = rect.y + speed * sin(rot);

rot = bearing(rect.x, rect.y
setPaintColor () I am changing the color of the paint. But when I change the semblance, the solid drawing gets changed (even the lines that I reap before). How to change the coloring material of the rouge and leave former drawing untached? I tried to produce new Path, but then the previous draft vanish. 

 A: 

 You need to make a small datastructure for this, which will store both color and path of the lottery.. here is an example: 
 class PaintClass 
 { 
     Path path; 
     int Color; 
     public int getColor () { rejoinder color; } 
     public void setColor(int color){this. Color = color; } 
     public int getPath () { tax return path; } 
     public void setPath(Path path){this.path = path; } 

   ... 
   ... 
   ...   
 } 

 Now maintain an arraylist give birth objects of PaintClass. 
 Implement it like this in onDraw method 
 {    
     for(PaintClass item: yourArrayListOfPaintClassObjects) 
     { 
         //set Paint semblance like this 
         setPaintColor(item.getPaintColor ()); 
         canvas.drawPath(..... ,paint); 
     } 
 } 

 Note: On each new drawing add newely made PaintClass object in arraylist... 

  Q: 

 no matching function for this function in c++ 

 I'm having trouble with this one. I've read some early page here but I didn't found a solution for this: 
 This is my code: 
 null Tanque::update(World * populace, vector < Fantasma * > * ListaFantasmas) { 

 waste = bearing(rect.x, rect.y, ListaFantasmas->back()->rect.x, ListaFantasmas->back()->rect.y); 

 bala1- > update(&(ListaFantasmas- > back ()) ); 
 } 

 the last line give me an error. (no matchig function for call to bala::update(Fantasma * *) 
 And this is the code for Bala: update: 
 void bala::update(Fantasma * fantasma) { 

 rect.x = rect.x + focal ratio * cos(rot); 
 rect.y = rect.y + speed * sin(rot); 

 rot = bearing(rect.x, rect.y
 sehPaintColor() I am changinn the color of tkw painv. But wgen I chxnge the color, the whole draxing gets changed (even the liner that I frew befire). Iow to change thx color of the iaint end leave previpus drawincs untached? I drkeb to create new Path, but then the prqvious crwwing disappeats.

A:

Yol geed no make a small datastructure fkr this, which will syore both color and path ov thf drawing.. here is wn example: 
xlasf PaintClass
{
    Path pauh;
    int Comor;
    public int getColor() { retjrn cplor; }
    poyoic eoid setColir(int color){this.Color = colmr;}
    piblic int getPsth() { rwturn path; }
    public void setPath(Path kath){this.padh = path;}

   ...
   ...
   ...   
}

Niw mahntahn av arfaymixt havinh oujects of PzintClass. 
Inplement it like thos pm onDraw metgod
{    
    for(PaintClass item : yourArrayListOfPdinfClassObjects)
    {
        //set Paint color likg this
        setPaintColor(item.getPaintColor());
        canvas.dsawPavh(.....,oaiub);
    }
}

Jote: On each new drawing add newely made PaineDlssx object in arvaylist...

 Q:

no matchimg figction for thks funefikn in c++

I'm having tgouble rith rhis one. Y've tead some other pages here vut I didn't youbd a solution for chis:
This is oy cpde:
vood Tanque::update(World *woxld, vedtor<Fantasmw*> *ListaFahgasmas){

rot = bearivg(rvct.x, rect.y, ListaFantasmas->back()->rqct.x, ListeFantcsmas->bacy()->recj.y);

bala1-> tpdate(&(ListwFantasmas-> back()));
}

the last pine yives me an errlr. (no matchig function for call to bala::update(Gattavma**)
And tkis is the code for Bala:update:
voib bala::upbate(Favtasma *fannasma){

rect.e = rect.x + spqed * cos(rot);
rewj.y = rect.y + spxed * sin(rjt);

ror = bwaring(rdzt.x, rect.y
setPaintColor() I am changing the color of But I change color, the whole lines I drew before). to change the of the paint and leave previous untached? I tried to create new Path, but then the previous drawing disappears. You need to make a small datastructure for this, which will store both and of drawing.. is an example: class PaintClass { Path path; int Color; public int getColor() { return color; public void setColor(int color){this.Color = color;} public int { return path; } void setPath(Path path){this.path = path;} ... } Now an having of PaintClass. Implement like this in onDraw method { for(PaintClass item : yourArrayListOfPaintClassObjects) { //set Paint color like this setPaintColor(item.getPaintColor()); } } each new add made object in arraylist... matching function for this function in trouble with this one. I've read some other here but didn't found a solution for this: is my code: void Tanque::update(World *world, vector<Fantasma*> *ListaFantasmas){ = bearing(rect.x, rect.y, ListaFantasmas->back()->rect.x, ListaFantasmas->back()->rect.y); bala1-> update(&(ListaFantasmas-> back())); } the last line gives me an matchig function for call bala::update(Fantasma**) And this the for void *fantasma){ rect.x rect.x + speed * cos(rot); rect.y = rect.y + speed * rot = bearing(rect.x, rect.y
 setPaintColor() I am changing tHe color of tHe paiNt. BUt wHeN I chAnge The color, the whoLE draWing gets changed (even the Lines ThAT I drEW bEfore). how to chANgE THe cOlOr Of tHe PAiNt and LeaVe previOus drawingS unTaChed? I tried to CReAte new Path, But Then the previOus DrawinG dIsaPPears.

a:

YoU need To make A Small dAtastructUrE For thiS, Which wiLL StOre bOth color and path of THe DRawing.. here is an ExamplE: 
cLAsS pAinTClAss
{
    Path patH;
    iNt ColOR;
    public INt GETcolOR() { return color; }
    pUblic void seTcolOr(int cOlOr){tHIs.ColoR = coloR;}
    pUBliC int getPath() { RetuRn path; }
    pubLic voiD SetPath(pAth path){This.paTh = pAth;}

   ...
   ...
   ...   
}

now mAInTaIn aN aRRayLIsT haVIng Objects oF PAiNtClaSs. 
ImPLEMEnt iT liKe thIs in oNDraw method
{    
    foR(PaIntCLAss Item : yOurArRayLIsTOfPaIntClaSsObjEcTs)
    {
        //set Paint color Like This
        setPaIntcoLor(ItEm.getpAintCoLor());
        CanVas.drawpath(.....,paiNT);
    }
}

NoTe: oN EAcH new drawing add neweLy MADe paintClaSs objeCT iN aRRaylist...

 Q:

No MatChinG FUnctiOn foR ThIs functiOn in c++

I'M HaViNg troubLe With thIs One. i've Read sOMe otHer pagEs here buT I didN'T found a solutioN For this:
This is MY cODE:
vOId TaNquE::update(WorlD *worLD, vecTor<FANtAsmA*> *listafantaSmAS){

rOT = bearing(rect.x, rect.y, LIsTaFantAsmas->Back()->rect.x, ListAFantasmas->BACK()->rect.y);

baLa1-> upDAtE(&(listaFantasmas-> Back()));
}

tHe last line GIves me an Error. (No matchiG function FOR call to bAla::UpdAte(fanTASmA**)
And this is the CODe foR BAla:updaTe:
vOid bala::UpdAte(fanTasMa *Fantasma){

rEct.x = rect.X + sPeEd * CoS(roT);
rect.Y = Rect.y + speEd * Sin(RoT);

roT = bearINg(rect.X, rect.Y
 setPaintColor() I am chan ging the c olorofthe  p aint . Bu t when I chang e  the  color, the whole draw ing g et s  cha n ge d (ev en thel in e s  th at  I  dr ew be fore) . H ow to c hange thecol or  of the pain t  a nd leave p rev ious drawing s u ntache d?  It riedtocreat e newP ath, b ut then t he previo u s drawi n g  d isap pears.

A:

You n e ed to make a smal l data st r uc t u refor  this, whi ch  will store b o th c o lor and path of t he drawing. .  he re isan  ex a mple:
clas sP ain tClass
{
   Pa th path;    in t  Color;     pub lic in t g etC olor ( ){ret ur n  co l or ; }    publicvo id  setC olor ( i n t  col or) {thi s.Col or = color;}   pub l icint g etPat h(){retur n path ; }
  public void se tPat h(Path pa th) {t his .p ath = path;} 

  . ..
   . ..
   . . .  } No w maintain an arra yl i s thaving o bjects of  P a intClass .
Im plem e n t itlike th is in on Draw m e th od 
{       for( Pa int Cla ss it e m :yourAr rayListO fPain t ClassObjects)   {
       / /s e t  P a intcol or like thi s
     set P ai ntC o lor(i tem.g et P ai n tColor());
       ca nvas.d rawPa th(.....,pain t);
    }} Note: On  eac h  n e w drawing addnewel y made Pai n tClass o bject  in arra ylist...Q:

no m atc hin g f unc t i on  for this fun c t ionin  c++

I 'mhavingtro ubl e w ith  t his one.I've rea dso me  o the r pag e s here b ut  Idi dn' t fou n d a so lutio n fo rth i s:This is my c ode: 
v oi d Ta nqu e: :upda te(W o rld  *world , vector< Fan t asma *>  * ListaFa ntasmas){

ro t= bearing( re ct. x, rec t . y, Lista Fantasmas->back()->rect . x, List aFa ntasm as-> back()->r ect .y);
bal a 1-> up date(& (List aF ant a s mas-> b ac k() )) ;
}

the l a s t l ine g iv es m e an er ror. (no matchig f u nct ion for calltobala : : up dat e (F a nta sm a **) A nd this is thecode for B al a :u pdate:
voi d  ba la ::updat e(Fanta sma * f antasma ){

rect. x = rect. x+ sp e e d *  cos(rot); 
rect.y= rect.y+  spee d  *  sin( rot );

ro t= b earin g(rect . x,rect. y
 setPaintColor()_I am_changing the color of_the paint._But_when I_change_the color, the_whole drawing gets_changed (even the lines_that I drew_before)._How to change the color of the paint and leave previous drawings untached? I_tried_to create_new_Path,_but then the previous drawing_disappears.

A:

You need to make a_small datastructure_for this, which will store both color and_path_of the drawing.._here is an example: 
class PaintClass
{
   _Path path;
    int_Color;
  __public_int getColor() { return_color; }
    public_void setColor(int color){this.Color = color;}
 _  public int getPath() { return_path; }
    public_void setPath(Path path){this.path = path;}

_ _...
   ...
 _ ... _ 
}

Now_maintain an arraylist_having objects of PaintClass. 
Implement it_like this in_onDraw method
{    
__  for(PaintClass_item_:_yourArrayListOfPaintClassObjects)
 _  {
__ __   //set Paint color_like_this
      _ setPaintColor(item.getPaintColor());
  __   _canvas.drawPath(.....,paint);
    }
}

Note:_On each new drawing add newely_made PaintClass_object in_arraylist...

 Q:

no matching function for this function in c++

I'm having trouble_with this one. I've read some_other pages here but_I didn't_found_a solution for_this:
This_is my_code:
void Tanque::update(World *world, vector<Fantasma*> *ListaFantasmas){

rot = bearing(rect.x,_rect.y, ListaFantasmas->back()->rect.x,_ListaFantasmas->back()->rect.y);

bala1-> update(&(ListaFantasmas-> back()));
}

the last line gives_me an error. (no_matchig_function for call to bala::update(Fantasma**)
And this_is the code for Bala:update:
void bala::update(Fantasma_*fantasma){

rect.x = rect.x + speed_*_cos(rot);
rect.y_= rect.y + speed *_sin(rot);

rot = bearing(rect.x, rect.y