Chess Assets

Share your advanced PureBasic knowledge/code with the community.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Chess Assets

Post by netmaestro »

I'm going to make a pgn viewer with it, but it's good for a lot of projects in the chess realm. Fully scalable and customizable.

Code: Select all

;300,sz
;///////////////////////////////////////////////////
;
; Module: Chess Assets
; All assets drawn with Vector library
; Copied from a popular public-domain design
; Author: netmaestro
; Date: April 17, 2020
; license: Do as you like, modify, say you
; wrote it, whatever. Make me proud.
;
;///////////////////////////////////////////////////

DeclareModule ChessAssets
  
  Structure Square
    x.i
    y.i
    size.i
    pid.s
  EndStructure
  
  Global NewMap square.square()
  
  Global w.d,h.d
  
  Declare WhiteKing  (sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
  Declare WhiteQueen (sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF) 
  Declare WhiteRook  (sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF) 
  Declare WhiteBishop(sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF) 
  Declare WhiteKnight(sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF) 
  Declare WhitePawn  (sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF) 
  Declare BlackKing  (sz.d, gradient.b=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000)
  Declare BlackQueen (sz.d, gradient.b=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000) 
  Declare BlackRook  (sz.d, gradient.b=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000) 
  Declare BlackBishop(sz.d, gradient.b=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000) 
  Declare BlackKnight(sz.d, gradient.b=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000) 
  Declare BlackPawn  (sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FF000000) 
  Declare ChessBoardWhitePlayer  (size, color1=$FFb7866e, color2=$FFfcfdf8)
  Declare ChessBoardBlackPlayer  (size, color1=$FFb7866e, color2=$FFfcfdf8)
  
  Macro GetFill_White()
    If gradient
      VectorSourceLinearGradient(0.0000*sz,0.5000*sz,1.0000*sz,0.5000*sz)
      VectorSourceGradientColor(fillcolor, 0.0)
      VectorSourceGradientColor(fillcolor, 0.3)
      VectorSourceGradientColor(RGBA(Red(fillcolor)*0.85,Green(fillcolor)*0.85,Blue(fillcolor)*0.85,255), 1.0)
    Else
      VectorSourceColor(fillcolor)
    EndIf
  EndMacro
  
  Macro GetFill_Black()
    If gradient
      VectorSourceLinearGradient(0.0000*sz,0.5000*sz,1.0000*sz,0.5000*sz)
      VectorSourceGradientColor(RGBA(Red(fillcolor)+60,Green(fillcolor)+60,Blue(fillcolor)+60,255), 0.0)
      VectorSourceGradientColor(fillcolor, 1.0)
    Else
      VectorSourceColor(fillcolor)
    EndIf
  EndMacro
  
EndDeclareModule

Module ChessAssets
  
  Procedure WhiteKing(sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
    result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
    StartVectorDrawing(ImageVectorOutput(result))
      MovePathCursor(0.5*sz,0.5*sz)
      AddPathCurve(0.6933*sz,0.0867*sz,1.1400*sz,0.4667*sz,0.7433*sz,0.6633*sz)
      AddPathLine(0.7447*sz,0.8366*sz)
      AddPathCurve(0.6333*sz,0.9100*sz,0.3666*sz,0.9100*sz,0.2533*sz,0.8366*sz)
      AddPathLine(0.2567*sz,0.6633*sz)
      AddPathCurve(-0.1400*sz,0.4667*sz,0.3067*sz,0.0867*sz,0.5*sz,0.5*sz)
      GetFill_White()
      FillPath(#PB_Path_Preserve)
      VectorSourceColor(linecolor)
      StrokePath(0.0366*sz,#PB_Path_Preserve)
      MovePathCursor(0.4300*sz,0.3900*sz)
      AddPathCurve(0.4333*sz,0.3600*sz,0.3833*sz,0.2600*sz,0.5*sz,0.22*sz)
      AddPathCurve(0.6166*sz,0.2600*sz,0.5666*sz,0.3600*sz,0.5700*sz,0.3900*sz)
      AddPathLine(0.5*sz,0.5*sz)
      AddPathLine(0.4300*sz,0.3900*sz)
      GetFill_White()
      FillPath(#PB_Path_Preserve)
      MovePathCursor(0.5*sz,0.5*sz)
      AddPathLine(0.5*sz,0.6033*sz)
      MovePathCursor(0.5*sz,0.073*sz)
      AddPathLine(0.5*sz,0.22*sz)
      MovePathCursor(0.44*sz,0.121*sz)
      AddPathLine(0.56*sz,0.121*sz)
      VectorSourceColor(linecolor)
      StrokePath(0.0366*sz,#PB_Path_RoundEnd)
      MovePathCursor(0.2533*sz,0.6633*sz)
      AddPathCurve(0.3666*sz,0.5900*sz,0.6333*sz,0.5900*sz,0.7433*sz,0.6633*sz)
      MovePathCursor(0.2533*sz,0.7466*sz)
      AddPathCurve(0.3666*sz,0.6766*sz,0.6333*sz,0.6766*sz,0.7433*sz,0.7433*sz)
      MovePathCursor(0.2533*sz,0.8366*sz)
      AddPathCurve(0.3666*sz,0.7633*sz,0.6333*sz,0.7633*sz,0.7433*sz,0.8366*sz)
      StrokePath(0.0366*sz)
    StopVectorDrawing()
    ProcedureReturn result
  EndProcedure
  
  Procedure WhiteQueen(sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
    result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
    StartVectorDrawing(ImageVectorOutput(result))
      MovePathCursor(0.8900*sz,0.2700*sz)
      AddPathLine(0.7533*sz,0.6867*sz)
      AddPathCurve(0.7433*sz,0.7100*sz,0.7500*sz,0.7333*sz,0.7600*sz,0.7600*sz)
      AddPathCurve(0.7867*sz,0.7733*sz,0.7867*sz,0.7967*sz,0.7800*sz,0.8200*sz)
      AddPathCurve(0.8000*sz,0.8400*sz,0.8067*sz,0.8533*sz,0.7867*sz,0.8767*sz)
      AddPathCurve(0.5933*sz,0.9067*sz,0.4000*sz,0.9067*sz,0.2133*sz,0.8767*sz)
      AddPathCurve(0.1867*sz,0.8600*sz,0.1867*sz,0.8400*sz,0.2133*sz,0.8200*sz)
      AddPathCurve(0.2067*sz,0.8000*sz,0.2067*sz,0.7733*sz,0.2400*sz,0.7600*sz)
      AddPathCurve(0.2533*sz,0.7367*sz,0.2533*sz,0.7100*sz,0.2433*sz,0.6867*sz)
      AddPathLine(0.1100*sz,0.2700*sz)
      AddPathLine(0.2900*sz,0.5533*sz)
      AddPathLine(0.2900*sz,0.1967*sz)
      AddPathLine(0.4300*sz,0.5433*sz)
      AddPathLine(0.5000*sz,0.1633*sz)
      AddPathLine(0.5700*sz,0.5433*sz)
      AddPathLine(0.7067*sz,0.2000*sz)
      AddPathLine(0.7067*sz,0.5533*sz)
      AddPathLine(0.8900*sz,0.2700*sz)
      AddPathCircle(0.0900*sz,0.2233*sz,0.0500*sz)
      AddPathCircle(0.2900*sz,0.1433*sz,0.0500*sz)
      AddPathCircle(0.5000*sz,0.1133*sz,0.0500*sz)
      AddPathCircle(0.7100*sz,0.1433*sz,0.0500*sz)
      AddPathCircle(0.9067*sz,0.2233*sz,0.0500*sz)
      GetFill_White()
      FillPath(#PB_Path_Preserve)
      MovePathCursor(0.7967*sz,0.5733*sz)
      AddPathCurve(0.6067*sz,0.5333*sz,0.3900*sz,0.5333*sz,0.2000*sz,0.5733*sz)
      MovePathCursor(0.2400*sz,0.7567*sz)
      AddPathCurve(0.4133*sz,0.7333*sz,0.5867*sz,0.7333*sz,0.7600*sz,0.7567*sz)
      MovePathCursor(0.2333*sz,0.6700*sz)
      AddPathCurve(0.4100*sz,0.6400*sz,0.5900*sz,0.6400*sz,0.7667*sz,0.6700*sz)
      VectorSourceColor(linecolor)
      StrokePath(0.0366*sz,#PB_Path_DiagonalCorner)
    StopVectorDrawing()
    ProcedureReturn result
  EndProcedure
  
  Procedure WhiteRook(sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
    result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
    StartVectorDrawing(ImageVectorOutput(result))
      MovePathCursor(0.2167*sz,0.2733*sz)
      AddPathLine(0.2167*sz,0.1567*sz)
      AddPathLine(0.3133*sz,0.1567*sz)
      AddPathLine(0.3133*sz,0.2000*sz)
      AddPathLine(0.4400*sz,0.2000*sz)
      AddPathLine(0.4400*sz,0.1567*sz)
      AddPathLine(0.5600*sz,0.1567*sz)
      AddPathLine(0.5600*sz,0.2000*sz)
      AddPathLine(0.6867*sz,0.2000*sz)
      AddPathLine(0.6867*sz,0.1567*sz)
      AddPathLine(0.7800*sz,0.1567*sz)
      AddPathLine(0.7800*sz,0.2667*sz)
      AddPathLine(0.6767*sz,0.3833*sz)
      AddPathLine(0.6767*sz,0.6233*sz)
      AddPathLine(0.7567*sz,0.7267*sz)
      AddPathLine(0.7567*sz,0.8200*sz)
      AddPathLine(0.8333*sz,0.8200*sz)
      AddPathLine(0.8333*sz,0.8933*sz)
      AddPathLine(0.1667*sz,0.8933*sz)
      AddPathLine(0.1667*sz,0.8200*sz)
      AddPathLine(0.2433*sz,0.8200*sz)
      AddPathLine(0.2433*sz,0.7267*sz)
      AddPathLine(0.3233*sz,0.6233*sz)
      AddPathLine(0.3233*sz,0.3833*sz)
      AddPathLine(0.2133*sz,0.2633*sz)
      GetFill_White()
      FillPath(#PB_Path_Preserve)
      MovePathCursor(0.2200*sz,0.2767*sz)
      AddPathLine(0.7833*sz,0.2767*sz)
      MovePathCursor(0.2467*sz,0.7267*sz)
      AddPathLine(0.7567*sz,0.7267*sz)
      MovePathCursor(0.2100*sz,0.8200*sz)
      AddPathLine(0.8000*sz,0.8200*sz)
      VectorSourceColor(linecolor)
      StrokePath(0.0366*sz,#PB_Path_RoundCorner)
      MovePathCursor(0.3267*sz,0.3867*sz)
      AddPathLine(0.6733*sz,0.3867*sz)
      MovePathCursor(0.3233*sz,0.6200*sz)
      AddPathLine(0.6767*sz,0.6200*sz)
      StrokePath(0.0167*sz,#PB_Path_RoundCorner)
    StopVectorDrawing()
    ProcedureReturn result
  EndProcedure
  
  Procedure WhiteBishop(sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
    
    result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
    StartVectorDrawing(ImageVectorOutput(result))
      MovePathCursor(0.5000*sz,0.2067*sz)
      AddPathCurve(0.7333*sz,0.2800*sz,0.7900*sz,0.5433*sz,0.6100*sz,0.5867*sz)
      AddPathCurve(0.7167*sz,0.6500*sz,0.7567*sz,0.7700*sz,0.5000*sz,0.7833*sz)
      AddPathCurve(0.6167*sz,0.8733*sz,0.8000*sz,0.7633*sz,0.9033*sz,0.8833*sz)
      AddPathCurve(0.8800*sz,0.9267*sz,0.8500*sz,0.8700*sz,0.7067*sz,0.8833*sz)
      AddPathCurve(0.6367*sz,0.8833*sz,0.5667*sz,0.8933*sz,0.5000*sz,0.8667*sz)
      AddPathCurve(0.4533*sz,0.8833*sz,0.4167*sz,0.8900*sz,0.2933*sz,0.8833*sz)
      AddPathCurve(0.1500*sz,0.8700*sz,0.1300*sz,0.9267*sz,0.1000*sz,0.8833*sz)
      AddPathCurve(0.1500*sz,0.7767*sz,0.3833*sz,0.8667*sz,0.5000*sz,0.7833*sz)
      AddPathCurve(0.1800*sz,0.7700*sz,0.3567*sz,0.5800*sz,0.3900*sz,0.5833*sz)
      AddPathCurve(0.2100*sz,0.5167*sz,0.2667*sz,0.2800*sz,0.5000*sz,0.2067*sz)
      AddPathCircle(0.5000*sz,0.1400*sz,0.0600*sz)
      GetFill_White()
      FillPath(#PB_Path_Preserve)
      MovePathCursor(0.3867*sz,0.5867*sz)
      AddPathLine(0.6100*sz,0.5867*sz)
      MovePathCursor(0.3167*sz,0.6867*sz)
      AddPathLine(0.6833*sz,0.6867*sz)
      VectorSourceColor(linecolor)
      StrokePath(0.0366*sz,#PB_Path_Preserve)
      MovePathCursor(0.4367*sz,0.3867*sz)
      AddPathLine(0.5633*sz,0.3867*sz)
      MovePathCursor(0.5000*sz,0.3233*sz)
      AddPathLine(0.5000*sz,0.4500*sz)
      StrokePath(0.0366*sz,#PB_Path_RoundEnd)
    StopVectorDrawing()
    ProcedureReturn result
  EndProcedure 
  
  Procedure WhiteKnight(sz.d, gradient.b=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
    result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
    StartVectorDrawing(ImageVectorOutput(result))
      MovePathCursor(0.5233*sz,0.1667*sz)
      AddPathCurve(0.8667*sz,0.2133*sz,0.9067*sz,0.5267*sz,0.8933*sz,0.8867*sz)
      AddPathLine(0.3267*sz,0.8867*sz)
      AddPathCurve(0.3000*sz,0.7000*sz,0.5767*sz,0.6667*sz,0.5033*sz,0.4800*sz)
      AddPathCurve(0.4667*sz,0.5167*sz,0.4333*sz,0.5267*sz,0.3767*sz,0.5467*sz)
      AddPathCurve(0.3233*sz,0.5800*sz,0.2800*sz,0.6333*sz,0.2533*sz,0.6967*sz)
      AddPathCurve(0.2200*sz,0.7267*sz,0.1833*sz,0.7000*sz,0.2033*sz,0.6667*sz)
      AddPathCurve(0.1267*sz,0.7167*sz,0.0167*sz,0.6000*sz,0.1533*sz,0.4500*sz)
      AddPathCurve(0.2500*sz,0.3333*sz,0.1667*sz,0.2833*sz,0.2700*sz,0.2167*sz)
      GetFill_White()
      FillPath(#PB_Path_Preserve)
      VectorSourceColor(linecolor)
      StrokePath(0.0366*sz,#PB_Path_RoundEnd)
      MovePathCursor(0.2867*sz,0.2500*sz)
      AddPathCurve(0.2600*sz,0.2100*sz,0.2433*sz,0.1367*sz,0.2467*sz,0.0867*sz)
      AddPathCurve(0.3000*sz,0.0967*sz,0.3500*sz,0.1300*sz,0.4033*sz,0.1867*sz)
      AddPathCurve(0.4133*sz,0.1567*sz,0.4300*sz,0.1233*sz,0.4600*sz,0.1000*sz)
      AddPathCurve(0.5133*sz,0.1333*sz,0.5233*sz,0.1667*sz,0.5300*sz,0.2333*sz)
      GetFill_White()
      FillPath(#PB_Path_Preserve)
      VectorSourceColor(linecolor)
      StrokePath(0.0366*sz,#PB_Path_RoundEnd)
      MovePathCursor(0.2067*sz,0.6667*sz)
      AddPathLine(0.2300*sz,0.6267*sz)
      MovePathCursor(0.5033*sz,0.4800*sz)
      AddPathCurve(0.5433*sz,0.4467*sz,0.5400*sz,0.4100*sz,0.5433*sz,0.3667*sz)
      MovePathCursor(0.4000*sz,0.1833*sz)
      MovePathCursor(0.2667*sz,0.3700*sz)
      AddPathCurve(0.2733*sz,0.3400*sz,0.2933*sz,0.3100*sz,0.3200*sz,0.2933*sz)
      StrokePath(0.0366*sz,#PB_Path_RoundEnd)
      AddPathCircle(0.2933*sz,0.3467*sz,0.0233*sz)
      FillPath()
      MovePathCursor(0.1500*sz,0.5933*sz)
      AddPathCurve(0.1467*sz,0.5733*sz,0.1633*sz,0.5533*sz,0.1667*sz,0.5500*sz)
      StrokePath(0.0366*sz,#PB_Path_RoundEnd)
      
      ProcedureReturn result
    EndProcedure
    
    Procedure WhitePawn(sz.d, gradient.b = 0, linecolor.q = $FF000000, fillcolor.q = $FFFFFFFF)
      result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
      StartVectorDrawing(ImageVectorOutput(result))
        MovePathCursor(0.6033*sz,0.5633*sz)
        AddPathCurve(0.7667*sz,0.6333*sz,0.7800*sz,0.8167*sz,0.7833*sz,0.8933*sz) 
        AddPathLine(0.2200*sz,0.8933*sz)                                          
        AddPathCurve(0.2233*sz,0.8167*sz,0.2400*sz,0.6333*sz,0.3933*sz,0.5633*sz)         
        AddPathCurve(0.3133*sz,0.4867*sz,0.3133*sz,0.3700*sz,0.4133*sz,0.3000*sz)
        AddPathCurve(0.3200*sz,0.0800*sz,0.6800*sz,0.0800*sz,0.5900*sz,0.3000*sz)
        AddPathCurve(0.6867*sz,0.3700*sz,0.6867*sz,0.4867*sz,0.6033*sz,0.5633*sz)
        GetFill_White()
        FillPath(#PB_Path_Preserve)
        VectorSourceColor(linecolor)
        StrokePath(0.0366*sz, #PB_Path_RoundEnd)
      StopVectorDrawing()
      ProcedureReturn result
    EndProcedure
    
    Procedure BlackKing(sz.d, gradient.b=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000)
      result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
      StartVectorDrawing(ImageVectorOutput(result))
        ;Black Shape & Fill
        GetFill_Black()
        MovePathCursor(0.5*sz,0.5*sz)
        AddPathCurve(0.6933*sz,0.0867*sz,1.1400*sz,0.4667*sz,0.7433*sz,0.6633*sz)
        AddPathLine(0.7447*sz,0.8366*sz)
        AddPathCurve(0.6333*sz,0.9100*sz,0.3666*sz,0.9100*sz,0.2533*sz,0.8366*sz)
        AddPathLine(0.2567*sz,0.6633*sz)
        AddPathCurve(-0.1400*sz,0.4667*sz,0.3067*sz,0.0867*sz,0.5*sz,0.5*sz)
        FillPath(#PB_Path_Preserve)
        MovePathCursor(0.4300*sz,0.3900*sz)
        AddPathCurve(0.4333*sz,0.3600*sz,0.3833*sz,0.2600*sz,0.5*sz,0.22*sz)
        AddPathCurve(0.6166*sz,0.2600*sz,0.5666*sz,0.3600*sz,0.5700*sz,0.3900*sz)
        AddPathLine(0.5*sz,0.5*sz)
        AddPathLine(0.4300*sz,0.3900*sz)
        FillPath(#PB_Path_Preserve)
        MovePathCursor(0.5*sz,0.5*sz)
        AddPathLine(0.5*sz,0.6033*sz)
        MovePathCursor(0.5*sz,0.073*sz)
        AddPathLine(0.5*sz,0.22*sz)
        MovePathCursor(0.44*sz,0.121*sz)
        AddPathLine(0.56*sz,0.121*sz)
        StrokePath(0.0366*sz,#PB_Path_RoundEnd)
        ; Light Lines
        MovePathCursor(0.5000*sz,0.5533*sz)
        AddPathCurve(0.6600*sz,0.0867*sz,1.1133*sz,0.4667*sz,0.7367*sz,0.6433*sz)
        MovePathCursor(0.5000*sz,0.5533*sz)
        AddPathCurve(0.3400*sz,0.0867*sz,-0.1067*sz,0.4667*sz,0.2567*sz,0.6433*sz)
        MovePathCursor(0.5*sz,0.55*sz)
        AddPathLine(0.5*sz,0.6033*sz)
        MovePathCursor(0.2533*sz,0.6633*sz)
        AddPathCurve(0.3666*sz,0.5900*sz,0.6333*sz,0.5900*sz,0.7433*sz,0.6633*sz)
        MovePathCursor(0.2533*sz,0.7466*sz)
        AddPathCurve(0.3666*sz,0.6766*sz,0.6333*sz,0.6766*sz,0.7433*sz,0.7433*sz)
        MovePathCursor(0.2533*sz,0.8366*sz)
        AddPathCurve(0.3666*sz,0.7633*sz,0.6333*sz,0.7633*sz,0.7433*sz,0.8366*sz)
        VectorSourceColor(linecolor)
        StrokePath(0.0366*sz,#PB_Path_RoundEnd)
        
      StopVectorDrawing()
      ProcedureReturn result
    EndProcedure
    
    Procedure BlackQueen(sz.d, gradient.b = 0, linecolor.q=$FFFFFFFF, fillcolor.q = $FF000000)
      result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
      StartVectorDrawing(ImageVectorOutput(result))
        ;Black Shape & Fill
        MovePathCursor(0.8900*sz,0.2700*sz)
        AddPathLine(0.7533*sz,0.6867*sz)
        AddPathCurve(0.7433*sz,0.7100*sz,0.7500*sz,0.7333*sz,0.7600*sz,0.7600*sz)
        AddPathCurve(0.7867*sz,0.7733*sz,0.7867*sz,0.7967*sz,0.7800*sz,0.8200*sz)
        AddPathCurve(0.8000*sz,0.8400*sz,0.8067*sz,0.8533*sz,0.7867*sz,0.8767*sz)
        AddPathCurve(0.5933*sz,0.9067*sz,0.4000*sz,0.9067*sz,0.2133*sz,0.8767*sz)
        AddPathCurve(0.1867*sz,0.8600*sz,0.1867*sz,0.8400*sz,0.2133*sz,0.8200*sz)
        AddPathCurve(0.2067*sz,0.8000*sz,0.2067*sz,0.7733*sz,0.2400*sz,0.7600*sz)
        AddPathCurve(0.2533*sz,0.7367*sz,0.2533*sz,0.7100*sz,0.2433*sz,0.6867*sz)
        AddPathLine(0.1100*sz,0.2700*sz)
        AddPathLine(0.2900*sz,0.5533*sz)
        AddPathLine(0.2900*sz,0.1967*sz)
        AddPathLine(0.4300*sz,0.5433*sz)
        AddPathLine(0.5000*sz,0.1633*sz)
        AddPathLine(0.5700*sz,0.5433*sz)
        AddPathLine(0.7067*sz,0.2000*sz)
        AddPathLine(0.7067*sz,0.5533*sz)
        AddPathLine(0.8900*sz,0.2700*sz)
        GetFill_Black()
        FillPath(#PB_Path_Preserve)
        StrokePath(0.0366*sz)
        AddPathCircle(0.0900*sz,0.2233*sz,0.0500*sz)
        AddPathCircle(0.2900*sz,0.1433*sz,0.0500*sz)
        AddPathCircle(0.5000*sz,0.1133*sz,0.0500*sz)
        AddPathCircle(0.7100*sz,0.1433*sz,0.0500*sz)
        AddPathCircle(0.9067*sz,0.2233*sz,0.0500*sz)
        GetFill_Black()
        FillPath(#PB_Path_Preserve)
        StrokePath(0.03366*sz,#PB_Path_DiagonalCorner)
        ; Light Lines
        MovePathCursor(0.2400*sz,0.6300*sz)
        AddPathCurve(0.4000*sz,0.5667*sz,0.5900*sz,0.5667*sz,0.7567*sz,0.6300*sz)
        MovePathCursor(0.2567*sz,0.7067*sz)
        AddPathLine(0.7433*sz,0.7067*sz)
        MovePathCursor(0.2333*sz,0.7833*sz)
        AddPathCurve(0.4067*sz,0.8133*sz,0.5867*sz,0.8133*sz,0.7633*sz,0.7833*sz)
        MovePathCursor(0.2033*sz,0.8500*sz)
        AddPathCurve(0.4067*sz,0.8833*sz,0.6033*sz,0.8833*sz,0.7800*sz,0.8500*sz)
        VectorSourceColor(linecolor)
        StrokePath(0.0366*sz, #PB_Path_RoundEnd)
      StopVectorDrawing()
      ProcedureReturn result
    EndProcedure
    
    Procedure BlackRook(sz.d, gradient.b = 0, linecolor.q=$FFFFFFFF, fillcolor.q = $FF000000)
      result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
      StartVectorDrawing(ImageVectorOutput(result))
        MovePathCursor(0.2167*sz,0.2733*sz)
        AddPathLine(0.2167*sz,0.1567*sz)
        AddPathLine(0.3133*sz,0.1567*sz)
        AddPathLine(0.3133*sz,0.2000*sz)
        AddPathLine(0.4400*sz,0.2000*sz)
        AddPathLine(0.4400*sz,0.1567*sz)
        AddPathLine(0.5600*sz,0.1567*sz)
        AddPathLine(0.5600*sz,0.2000*sz)
        AddPathLine(0.6867*sz,0.2000*sz)
        AddPathLine(0.6867*sz,0.1567*sz)
        AddPathLine(0.7800*sz,0.1567*sz)
        AddPathLine(0.7800*sz,0.2667*sz)
        AddPathLine(0.6767*sz,0.3833*sz)
        AddPathLine(0.6767*sz,0.6233*sz)
        AddPathLine(0.7567*sz,0.7267*sz)
        AddPathLine(0.7567*sz,0.8200*sz)
        AddPathLine(0.8333*sz,0.8200*sz)
        AddPathLine(0.8333*sz,0.8933*sz)
        AddPathLine(0.1667*sz,0.8933*sz)
        AddPathLine(0.1667*sz,0.8200*sz)
        AddPathLine(0.2433*sz,0.8200*sz)
        AddPathLine(0.2433*sz,0.7267*sz)
        AddPathLine(0.3233*sz,0.6233*sz)
        AddPathLine(0.3233*sz,0.3833*sz)
        AddPathLine(0.2133*sz,0.2633*sz)
        GetFill_Black()
        FillPath(#PB_Path_Preserve)
        StrokePath(0.0366*sz,#PB_Path_RoundCorner)
        MovePathCursor(0.2267*sz,0.2767*sz)
        AddPathLine(0.7700*sz,0.2767*sz)
        MovePathCursor(0.2667*sz,0.7267*sz)
        AddPathLine(0.7367*sz,0.7267*sz)
        MovePathCursor(0.2467*sz,0.8200*sz)
        AddPathLine(0.7600*sz,0.8200*sz)
        MovePathCursor(0.3267*sz,0.3867*sz)
        AddPathLine(0.6733*sz,0.3867*sz)
        MovePathCursor(0.3233*sz,0.6200*sz)
        AddPathLine(0.6767*sz,0.6200*sz)
        VectorSourceColor(linecolor)
        StrokePath(0.0240*sz,#PB_Path_RoundEnd)
      StopVectorDrawing()
      ProcedureReturn result
    EndProcedure
    
    Procedure BlackBishop(sz.d, gradient.b = 0, linecolor.q=$FFFFFFFF, fillcolor.q = $FF000000)
      result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
      StartVectorDrawing(ImageVectorOutput(result))
        MovePathCursor(0.5000*sz,0.2067*sz)
        AddPathCurve(0.7333*sz,0.2800*sz,0.7900*sz,0.5433*sz,0.6100*sz,0.5867*sz)
        AddPathCurve(0.7167*sz,0.6500*sz,0.7567*sz,0.7700*sz,0.5000*sz,0.7833*sz)
        AddPathCurve(0.6167*sz,0.8733*sz,0.8000*sz,0.7633*sz,0.9033*sz,0.8833*sz)
        AddPathCurve(0.8800*sz,0.9267*sz,0.8500*sz,0.8700*sz,0.7067*sz,0.8833*sz)
        AddPathCurve(0.6367*sz,0.8833*sz,0.5667*sz,0.8933*sz,0.5000*sz,0.8667*sz)
        AddPathCurve(0.4533*sz,0.8833*sz,0.4167*sz,0.8900*sz,0.2933*sz,0.8833*sz)
        AddPathCurve(0.1500*sz,0.8700*sz,0.1300*sz,0.9267*sz,0.1000*sz,0.8833*sz)
        AddPathCurve(0.1500*sz,0.7767*sz,0.3833*sz,0.8667*sz,0.5000*sz,0.7833*sz)
        AddPathCurve(0.1800*sz,0.7700*sz,0.3567*sz,0.5800*sz,0.3900*sz,0.5833*sz)
        AddPathCurve(0.2100*sz,0.5167*sz,0.2667*sz,0.2800*sz,0.5000*sz,0.2067*sz)
        AddPathCircle(0.5000*sz,0.1400*sz,0.0600*sz)
        GetFill_Black()
        FillPath(#PB_Path_Preserve)
        StrokePath(0.0366*sz,#PB_Path_RoundEnd)
        MovePathCursor(0.3867*sz,0.5867*sz)
        AddPathLine(0.6100*sz,0.5867*sz)
        MovePathCursor(0.3167*sz,0.6867*sz)
        AddPathLine(0.6833*sz,0.6867*sz)
        MovePathCursor(0.4367*sz,0.3867*sz)
        AddPathLine(0.5633*sz,0.3867*sz)
        MovePathCursor(0.5000*sz,0.3233*sz)
        AddPathLine(0.5000*sz,0.4500*sz)
        VectorSourceColor(linecolor)
        StrokePath(0.0366*sz,#PB_Path_RoundEnd)
      StopVectorDrawing()
      ProcedureReturn result
    EndProcedure
    
    Procedure BlackKnight(sz.d, gradient.b = 0, linecolor.q=$FFFFFFFF, fillcolor.q = $FF000000)
      result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
      StartVectorDrawing(ImageVectorOutput(result))
        MovePathCursor(0.5233*sz,0.1667*sz)
        AddPathCurve(0.8667*sz,0.2133*sz,0.9067*sz,0.5267*sz,0.8933*sz,0.8867*sz)
        AddPathLine(0.3267*sz,0.8867*sz)
        AddPathCurve(0.3000*sz,0.7000*sz,0.5767*sz,0.6667*sz,0.5033*sz,0.4800*sz)
        AddPathCurve(0.4667*sz,0.5167*sz,0.4333*sz,0.5267*sz,0.3767*sz,0.5467*sz)
        AddPathCurve(0.3233*sz,0.5800*sz,0.2800*sz,0.6333*sz,0.2533*sz,0.6967*sz)
        AddPathCurve(0.2200*sz,0.7267*sz,0.1833*sz,0.7000*sz,0.2067*sz,0.6667*sz)
        AddPathCurve(0.1267*sz,0.7167*sz,0.0167*sz,0.6000*sz,0.1533*sz,0.4500*sz)
        AddPathCurve(0.2500*sz,0.3333*sz,0.1667*sz,0.2833*sz,0.2700*sz,0.2167*sz)
        GetFill_Black()
        FillPath(#PB_Path_Preserve)
        StrokePath(0.0366*sz,#PB_Path_RoundEnd)
        MovePathCursor(0.3533*sz,0.2333*sz)
        AddPathCircle(0.3533*sz,0.2333*sz,0.0167*sz,260,50,#PB_Path_CounterClockwise)
        AddPathCurve(0.7667*sz,0.1233*sz,0.8333*sz,0.5100*sz,0.8033*sz,0.8600*sz)
        AddPathLine(0.8767*sz,0.8600*sz)
        AddPathCurve(0.9167*sz,0.2667*sz,0.6333*sz,0.1000*sz,0.3433*sz,0.2200*sz)
        VectorSourceColor(linecolor)
        FillPath()
        MovePathCursor(0.2867*sz,0.2500*sz)
        AddPathCurve(0.2600*sz,0.2100*sz,0.2433*sz,0.1367*sz,0.2467*sz,0.0867*sz)
        AddPathCurve(0.3000*sz,0.0967*sz,0.3500*sz,0.1300*sz,0.4033*sz,0.1867*sz)
        MovePathCursor(0.4033*sz,0.2533*sz)
        AddPathCurve(0.4133*sz,0.1567*sz,0.4300*sz,0.1233*sz,0.4600*sz,0.1000*sz)
        AddPathCurve(0.5133*sz,0.1333*sz,0.5233*sz,0.1667*sz,0.5300*sz,0.2333*sz)
        GetFill_Black()
        FillPath(#PB_Path_Preserve)
        StrokePath(0.0366*sz,#PB_Path_RoundEnd)
        MovePathCursor(0.2067*sz,0.6667*sz)
        AddPathLine(0.2300*sz,0.6267*sz)
        MovePathCursor(0.5033*sz,0.4800*sz)
        AddPathCurve(0.5433*sz,0.4467*sz,0.5400*sz,0.4100*sz,0.5433*sz,0.3667*sz)
        MovePathCursor(0.4000*sz,0.1833*sz)
        MovePathCursor(0.2667*sz,0.3700*sz)
        AddPathCurve(0.2733*sz,0.3400*sz,0.2933*sz,0.3100*sz,0.3200*sz,0.2933*sz)
        VectorSourceColor(linecolor)
        StrokePath(0.0267*sz,#PB_Path_RoundEnd)
        AddPathCircle(0.2933*sz,0.3467*sz,0.0233*sz)
        FillPath()
        MovePathCursor(0.1500*sz,0.5933*sz)
        AddPathCurve(0.1467*sz,0.5733*sz,0.1633*sz,0.5533*sz,0.1667*sz,0.5500*sz)
        StrokePath(0.0267*sz,#PB_Path_RoundEnd)
      StopVectorDrawing()
      ProcedureReturn result
    EndProcedure
    
    Procedure BlackPawn(sz.d, gradient.b = 0, linecolor.q = $FF000000, fillcolor.q = $FF000000)
      result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
      StartVectorDrawing(ImageVectorOutput(result))
        MovePathCursor(0.6033*sz,0.5633*sz)
        AddPathCurve(0.7667*sz,0.6333*sz,0.7800*sz,0.8167*sz,0.7833*sz,0.8933*sz) 
        AddPathLine(0.2200*sz,0.8933*sz)                                          
        AddPathCurve(0.2233*sz,0.8167*sz,0.2400*sz,0.6333*sz,0.3933*sz,0.5633*sz)         
        AddPathCurve(0.3133*sz,0.4867*sz,0.3133*sz,0.3700*sz,0.4133*sz,0.3000*sz)
        AddPathCurve(0.3200*sz,0.0800*sz,0.6800*sz,0.0800*sz,0.5900*sz,0.3000*sz)
        AddPathCurve(0.6867*sz,0.3700*sz,0.6867*sz,0.4867*sz,0.6033*sz,0.5633*sz)
        GetFill_Black()
        FillPath(#PB_Path_Preserve)
        VectorSourceColor(linecolor)
        StrokePath(0.0100*sz, #PB_Path_RoundEnd)
      StopVectorDrawing()
      ProcedureReturn result
    EndProcedure
    
    Procedure ChessBoardWhitePlayer(size, color1=$FFb7866e, color2=$FFfcfdf8)
      Protected ret.i, p.d=size
      Shared w.d, h.d
      ret = CreateImage(#PB_Any, size, size,32, #PB_Image_Transparent)
      StartVectorDrawing(ImageVectorOutput(ret))
        
        squareids    = LoadFont(#PB_Any, "Arial", 11, #PB_Font_Bold)
        squaretamps = LoadFont(#PB_Any, "verdana", 10)
        
        VectorSourceColor(color2)
        AddPathBox(0, 0, size, size)
        FillPath()   
        MovePathCursor(0,0)
        AddPathBox(0, 0, size, size)
        VectorSourceColor($ff000000)
        StrokePath(2)
        
        VectorSourceColor(color1)
        MovePathCursor(0,0)
        AddPathBox(0.04*p,0.04*p,0.92*p,0.92*p)
        StrokePath(0.0075*p)
        AddPathBox(0.05*p, 0.05*p,0.90*p, 0.90*p)
        StrokePath(0.004*p)
        
        x.d = 0.05*p : y.d = 0.05*p : yy.d = y
        w.d = (p-(0.05*p)*2)/8 : h.d = w
        
        For i=1 To 4
          AddPathBox(x+w,yy,w,h)
          AddPathBox(x+w*3,yy,w,h)
          AddPathBox(x+w*5,yy,w,h)
          AddPathBox(x+w*7,yy,w,h)
          yy+h
          AddPathBox(x,yy,w,h)
          AddPathBox(x+w*2,yy,w,h)
          AddPathBox(x+w*4,yy,w,h)
          AddPathBox(x+w*6,yy,w,h)
          yy+h
        Next
        
        VectorSourceColor(color1)
        FillPath()
        
        For j=1 To 8
          For i=1 To 8
            With square(Chr(j+96)+Str(i))
              \x = x + w * (j-1)
              \y = y + h * (8-i)
            EndWith
          Next
        Next
        
        ;       ForEach square()
        ;         text$ = square()\id
        ;         MovePathCursor(square()\x,square()\y)
        ;         VectorFont(FontID(squaretamps))
        ;         VectorSourceColor(RGBA(0,0,0,255))
        ;         DrawVectorText(text$)
        ;       Next
        
        VectorFont(FontID(squareids), p/36)
        y=0.05*p + h/2 - p/64
        For i=8 To 1 Step -1
          MovePathCursor(p*0.012, y)
          DrawVectorText(Str(i))
          MovePathCursor((p-p*0.012)-VectorTextWidth(Str(i)), y)
          DrawVectorText(Str(i))
          y+h
        Next
        
        x=0.05*p + w/2 - VectorTextWidth("A")/2
        y=p-p*0.003-VectorTextHeight("A")
        For i=97 To 104
          MovePathCursor(x, y)
          DrawVectorText(Chr(i))
          MovePathCursor(x, p*0.0035)
          DrawVectorText(Chr(i))
          x+w
        Next
      StopVectorDrawing()
      
      ProcedureReturn ret
      
    EndProcedure
    
    Procedure ChessBoardBlackPlayer(size, color1=$FFb7866e, color2=$FFfcfdf8)
      Protected ret.i, p.d=size
      
      ret = CreateImage(#PB_Any, size, size)
      StartVectorDrawing(ImageVectorOutput(ret))
        
        squareids    = LoadFont(#PB_Any, "Arial", 11, #PB_Font_Bold)
        squaretamps = LoadFont(#PB_Any, "verdana", 10)
        
        VectorSourceColor(color2)
        AddPathBox(0, 0, size, size)
        FillPath()   
        MovePathCursor(0,0)
        AddPathBox(0, 0, size, size)
        VectorSourceColor(RGBA(0,0,0,255))
        StrokePath(2)
        
        VectorSourceColor(color1)
        MovePathCursor(0,0)
        AddPathBox(0.04*p,0.04*p,0.92*p,0.92*p)
        StrokePath(0.0075*p)
        AddPathBox(0.05*p, 0.05*p,0.90*p, 0.90*p)
        StrokePath(0.004*p)
        
        x.d = 0.05*p : y.d = 0.05*p
        w.d = (p-(0.05*p)*2)/8 : h.d = w
        
        For i=1 To 4
          AddPathBox(x+w,y,w,h)
          AddPathBox(x+w*3,y,w,h)
          AddPathBox(x+w*5,y,w,h)
          AddPathBox(x+w*7,y,w,h)
          y+h
          AddPathBox(x,y,w,h)
          AddPathBox(x+w*2,y,w,h)
          AddPathBox(x+w*4,y,w,h)
          AddPathBox(x+w*6,y,w,h)
          y+h
        Next
        VectorSourceColor(color1)
        FillPath()
        
        For j=8 To 1 Step -1
          For i=8 To 1 Step -1
            With square(Chr(j+96)+Str(i))
              \x = x + w * (8-j)
              \y = y + h * (i-9)
            EndWith
          Next
        Next
        
        ;       ForEach square()
        ;         text$ = square()\id
        ;         MovePathCursor(square()\x,square()\y)
        ;         VectorFont(FontID(squaretamps))
        ;         VectorSourceColor(RGBA(0,0,0,255))
        ;         DrawVectorText(text$)
        ;       Next     
        
        VectorFont(FontID(squareids), p/36)
        y=0.05*p + h/2 - p/64
        For i=1 To 8
          MovePathCursor(p*0.012, y)
          DrawVectorText(Str(i))
          MovePathCursor((p-p*0.012)-VectorTextWidth(Str(i)), y)
          DrawVectorText(Str(i))
          y+h
        Next
        
        x=0.05*p + w/2 - VectorTextWidth("A")/2
        y=p-p*0.003-VectorTextHeight("A")
        For i=104 To 97 Step -1
          MovePathCursor(x, y)
          DrawVectorText(Chr(i))
          MovePathCursor(x, p*0.0035)
          DrawVectorText(Chr(i))
          x+w
        Next
      StopVectorDrawing()
      
      ProcedureReturn ret
      
    EndProcedure
    
  EndModule
  
  ;Test:
  
  UseModule ChessAssets
  board = ChessBoardBlackPlayer(900)
  wk = WhiteKing  (w,1)
  wq = WhiteQueen (w,1)
  wr = WhiteRook  (w,1)
  wb = WhiteBishop(w,1)
  wn = WhiteKnight(w,1)
  wp = WhitePawn  (w,1)
  bk = BlackKing  (w,1)
  bq = BlackQueen (w,1)
  br = BlackRook  (w,1)
  bb = BlackBishop(w,1)
  bn = BlackKnight(w,1)
  bp = BlackPawn  (w,1)
  
  StartDrawing(ImageOutput(board))
    DrawAlphaImage(ImageID(wk),square("e1")\x,square("e1")\y)
    DrawAlphaImage(ImageID(wq),square("d1")\x,square("e1")\y)
    DrawAlphaImage(ImageID(wb),square("c1")\x,square("e1")\y)
    DrawAlphaImage(ImageID(wn),square("b1")\x,square("e1")\y)
    DrawAlphaImage(ImageID(wr),square("a1")\x,square("e1")\y)
    DrawAlphaImage(ImageID(wb),square("f1")\x,square("e1")\y)
    DrawAlphaImage(ImageID(wn),square("g1")\x,square("e1")\y)
    DrawAlphaImage(ImageID(wr),square("h1")\x,square("e1")\y)
    For i=97 To 104
      DrawAlphaImage(ImageID(wp),square(Chr(i)+"2")\x,square(Chr(i)+"2")\y)
    Next
    DrawAlphaImage(ImageID(bk),square("e8")\x,square("e8")\y)
    DrawAlphaImage(ImageID(bq),square("d8")\x,square("e8")\y)
    DrawAlphaImage(ImageID(bb),square("c8")\x,square("e8")\y)
    DrawAlphaImage(ImageID(bn),square("b8")\x,square("e8")\y)
    DrawAlphaImage(ImageID(br),square("a8")\x,square("e8")\y)
    DrawAlphaImage(ImageID(bb),square("f8")\x,square("e8")\y)
    DrawAlphaImage(ImageID(bn),square("g8")\x,square("e8")\y)
    DrawAlphaImage(ImageID(br),square("h8")\x,square("e8")\y)
    For i=97 To 104
      DrawAlphaImage(ImageID(bp),square(Chr(i)+"7")\x,square(Chr(i)+"7")\y)
    Next
  StopDrawing()
  
  OpenWindow(0,0,0,ImageWidth(board),ImageHeight(board),"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
  ImageGadget(0,0,0,0,0,ImageID(board))
  Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
Last edited by netmaestro on Sat May 09, 2020 2:42 am, edited 3 times in total.
BERESHEIT
Mohsen

Re: Chess Assets

Post by Mohsen »

Wow excellent, thank you for sharing :D
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 460
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Chess Assets

Post by Mindphazer »

Amazing !! :shock:
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
Kiffi
Addict
Addict
Posts: 1503
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Chess Assets

Post by Kiffi »

Fancy! Image

Image
Hygge
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Chess Assets

Post by davido »

@netmaestro,
I am glad you were disappointed.
Nobody will be disappointed with this masterpiece. It is easy to run out of superlatives.
Perhaps there should be a Grandmaster title for PB.
DE AA EB
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: Chess Assets

Post by Mijikai »

rly great thx :D
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Chess Assets

Post by Kwai chang caine »

Splendid !!!! Pfffff...all this works ...... :shock:
Now ... i'm sure you training your big brain of KarpovMaestro , for create mathematical algorithm in back :lol:

Just a stupid question, from the specialist :mrgreen:
I have see you create white and black procedure for the same piece, it's not possible to adding a color parameter of the body :oops:

Thanks a lot for sharing this jewel 8)
ImageThe happiness is a road...
Not a destination
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Chess Assets

Post by netmaestro »

I have see you create white and black procedure for the same piece, it's not possible to adding a color parameter of the body
Unfortunately not. The lines on all the black pieces are different from the white ones. But it wasn't much work for the black pieces because the shape was already made for the white ones, it was just a matter of copy/paste and adding the light lines. The black pawn took about 2 minutes because there are no light lines on it.

Thanks to all for the kind words!
BERESHEIT
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Re: Chess Assets

Post by kinglestat »

@netmaestro
You live up to your namesake.
That's a really nice piece of code; King like!
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Chess Assets

Post by Kwai chang caine »

@NETMAESTRO
Thanks for your explanation 8)
kinglestat wrote:You live up to your namesake.
Sure.... NETMAESTRO is one of my favorite heroes since the begining.
As soon i seen him, so beautiful and ROYAL ....

Image

so fast

Image

so "young"
Image

and so strong with a machine, in the same time :shock:

Image

there are already ......pffffffiooou ... a very long time :shock:
KCC, the little grasshopper, is so proud to have cross his road 8) and especially not to have been eaten by him :lol:
ImageThe happiness is a road...
Not a destination
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Chess Assets

Post by netmaestro »

Made a modification to the knights, cleaned their shape up a bit to look more like a mean horse and less like an inebriated donkey. Working on a functioning chess clock control (analog), I'll add it to the assets when it's ready.
BERESHEIT
Joris
Addict
Addict
Posts: 890
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: Chess Assets

Post by Joris »

Very nice.
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
dige
Addict
Addict
Posts: 1406
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: Chess Assets

Post by dige »

Well done, netmaestro! Thx for sharing :D
"Daddy, I'll run faster, then it is not so far..."
User avatar
ar-s
Enthusiast
Enthusiast
Posts: 344
Joined: Sat Oct 06, 2007 11:20 pm
Location: France

Re: Chess Assets

Post by ar-s »

Very nice, thanks for sharing :D
~Ar-S~
My Image Hoster for PB users
My webSite (french) with PB apps : LDVMULTIMEDIA
PB - 3.x / 5.7x / 6 - W11 x64 - Ryzen 7 3700x / #Rpi4

Code: Select all

r3p347 : 7ry : un71l d0n3 = 1
User avatar
Michael Vogel
Addict
Addict
Posts: 2807
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Chess Assets

Post by Michael Vogel »

Great one, Maestro!

What about another tuning? Did only a first step, your unruly racing horses don't look perfect now... :lol:

Code: Select all

;///////////////////////////////////////////////////
;
; Module: Chess Assets
; All assets drawn with Vector library
; Copied from a popular public-domain design
; Author: netmaestro
; Date: April 17, 2020
; license: Do as you like, modify, say you
; wrote it, whatever. Make me proud.
;
;///////////////////////////////////////////////////

DeclareModule ChessAssets

	Structure Square
		id.s
		x.i
		y.i
		size.i
		p_id.i
	EndStructure

	Global NewMap squares.square()

	Global w.d,h.d

	Declare WhiteKing  (sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
	Declare WhiteQueen (sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
	Declare WhiteRook  (sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
	Declare WhiteBishop(sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
	Declare WhiteKnight(sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
	Declare WhitePawn  (sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
	Declare BlackKing  (sz.d, gradient.i=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000)
	Declare BlackQueen (sz.d, gradient.i=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000)
	Declare BlackRook  (sz.d, gradient.i=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000)
	Declare BlackBishop(sz.d, gradient.i=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000)
	Declare BlackKnight(sz.d, gradient.i=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000)
	Declare BlackPawn  (sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FF000000)
	Declare ChessBoardWhitePlayer  (size.i, color1.i, color2.i)
	Declare ChessBoardBlackPlayer  (size.i, color1.i, color2.i)

	Macro GetFill_White(inverse=0)
		If gradient
			VectorSourceLinearGradient(0.0000*sz,0.5000*sz,1.0000*sz,0.5000*sz)
			VectorSourceGradientColor(fillcolor, inverse+(1-2*inverse)*0.0)
			VectorSourceGradientColor(fillcolor, inverse+(1-2*inverse)*0.3)
			VectorSourceGradientColor(RGBA(Red(fillcolor)-55,Green(fillcolor)-55,Blue(fillcolor)-55,255), inverse+(1-2*inverse)*1.0)
		Else
			VectorSourceColor(fillcolor)
		EndIf
	EndMacro
	Macro GetFill_Black(inverse=0)
		If gradient
			#LightenUp=20
			VectorSourceLinearGradient(0.0000*sz,0.5000*sz,1.0000*sz,0.5000*sz)
			VectorSourceGradientColor(RGBA(Red(fillcolor)+100+#LightenUp*inverse,Green(fillcolor)+100+#LightenUp*inverse,Blue(fillcolor)+100+#LightenUp*inverse,255),inverse+(1-2*inverse)*0.0)
			VectorSourceGradientColor(RGBA(Red(fillcolor)+#LightenUp*inverse,Green(fillcolor)+#LightenUp*inverse,Blue(fillcolor)+#LightenUp*inverse,255), inverse+(1-2*inverse)*1.0)
		Else
			VectorSourceColor(fillcolor)
		EndIf
	EndMacro

	Macro Border_White()
		If gradient>1
			GetFill_White(1)
			StrokePath(sz/120*(8+gradient),#PB_Path_Preserve|#PB_Path_RoundCorner|#PB_Path_RoundEnd)
		EndIf
	EndMacro
	Macro Border_Black()
		If gradient>1
			GetFill_Black(1)
			StrokePath(sz/150*(8+gradient),#PB_Path_Preserve|#PB_Path_RoundCorner|#PB_Path_RoundEnd)
		EndIf
	EndMacro
EndDeclareModule

Module ChessAssets

	Procedure WhiteKing(sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.5*sz,0.5*sz)
		AddPathCurve(0.6933*sz,0.0867*sz,1.1400*sz,0.4667*sz,0.7433*sz,0.6633*sz)
		AddPathLine(0.7447*sz,0.8366*sz)
		AddPathCurve(0.6333*sz,0.9100*sz,0.3666*sz,0.9100*sz,0.2533*sz,0.8366*sz)
		AddPathLine(0.2567*sz,0.6633*sz)
		AddPathCurve(-0.1400*sz,0.4667*sz,0.3067*sz,0.0867*sz,0.5*sz,0.5*sz)
		Border_White()
		GetFill_White()
		FillPath(#PB_Path_Preserve)
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz,#PB_Path_Preserve)
		MovePathCursor(0.4300*sz,0.3900*sz)
		AddPathCurve(0.4333*sz,0.3600*sz,0.3833*sz,0.2600*sz,0.5*sz,0.22*sz)
		AddPathCurve(0.6166*sz,0.2600*sz,0.5666*sz,0.3600*sz,0.5700*sz,0.3900*sz)
		AddPathLine(0.5*sz,0.5*sz)
		AddPathLine(0.4300*sz,0.3900*sz)
		Border_White()
		GetFill_White()
		FillPath(#PB_Path_Preserve)
		MovePathCursor(0.5*sz,0.5*sz)
		AddPathLine(0.5*sz,0.6033*sz)
		MovePathCursor(0.5*sz,0.073*sz)
		AddPathLine(0.5*sz,0.22*sz)
		MovePathCursor(0.44*sz,0.121*sz)
		AddPathLine(0.56*sz,0.121*sz)
		Border_White()
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		MovePathCursor(0.2533*sz,0.6633*sz)
		AddPathCurve(0.3666*sz,0.5900*sz,0.6333*sz,0.5900*sz,0.7433*sz,0.6633*sz)
		MovePathCursor(0.2533*sz,0.7466*sz)
		AddPathCurve(0.3666*sz,0.6766*sz,0.6333*sz,0.6766*sz,0.7433*sz,0.7433*sz)
		MovePathCursor(0.2533*sz,0.8366*sz)
		AddPathCurve(0.3666*sz,0.7633*sz,0.6333*sz,0.7633*sz,0.7433*sz,0.8366*sz)
		StrokePath(0.0366*sz)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure
	Procedure WhiteQueen(sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.8900*sz,0.2700*sz)
		AddPathArc(0.8333*sz,0.5967*sz,0.8267*sz,0.6067*sz,0.1200*sz)
		AddPathLine(0.7533*sz,0.6867*sz)
		AddPathCurve(0.7433*sz,0.7100*sz,0.7500*sz,0.7333*sz,0.7600*sz,0.7600*sz)
		AddPathCurve(0.7867*sz,0.7733*sz,0.7867*sz,0.7967*sz,0.7800*sz,0.8200*sz)
		AddPathCurve(0.8000*sz,0.8400*sz,0.8067*sz,0.8533*sz,0.7867*sz,0.8767*sz)
		AddPathCurve(0.5933*sz,0.9067*sz,0.4000*sz,0.9067*sz,0.2133*sz,0.8767*sz)
		AddPathCurve(0.1867*sz,0.8600*sz,0.1867*sz,0.8400*sz,0.2133*sz,0.8200*sz)
		AddPathCurve(0.2067*sz,0.8000*sz,0.2067*sz,0.7733*sz,0.2400*sz,0.7600*sz)
		AddPathCurve(0.2533*sz,0.7367*sz,0.2533*sz,0.7100*sz,0.2433*sz,0.6867*sz)
		AddPathArc(0.1633*sz,0.6033*sz,0.1600*sz,0.5767*sz,0.1200*sz)
		AddPathLine(0.1100*sz,0.2700*sz)
		AddPathLine(0.2900*sz,0.5533*sz)
		AddPathLine(0.2900*sz,0.1967*sz)
		AddPathLine(0.4300*sz,0.5433*sz)
		AddPathLine(0.5000*sz,0.1633*sz)
		AddPathLine(0.5700*sz,0.5433*sz)
		AddPathLine(0.7067*sz,0.2000*sz)
		AddPathLine(0.7067*sz,0.5533*sz)
		AddPathLine(0.8900*sz,0.2700*sz)
		AddPathCircle(0.0900*sz,0.2233*sz,0.0500*sz)
		AddPathCircle(0.2900*sz,0.1433*sz,0.0500*sz)
		AddPathCircle(0.5000*sz,0.1133*sz,0.0500*sz)
		AddPathCircle(0.7100*sz,0.1433*sz,0.0500*sz)
		AddPathCircle(0.9067*sz,0.2233*sz,0.0500*sz)
		Border_White()
		GetFill_White()
		FillPath(#PB_Path_Preserve)
		MovePathCursor(0.8333*sz,0.5733*sz)
		AddPathCurve(0.6067*sz,0.5333*sz,0.3900*sz,0.5333*sz,0.1667*sz,0.5733*sz)
		MovePathCursor(0.2400*sz,0.7567*sz)
		AddPathCurve(0.4133*sz,0.7333*sz,0.5867*sz,0.7333*sz,0.7600*sz,0.7567*sz)
		MovePathCursor(0.2333*sz,0.6700*sz)
		AddPathCurve(0.4100*sz,0.6400*sz,0.5900*sz,0.6400*sz,0.7667*sz,0.6700*sz)
		VectorSourceColor(linecolor)
		StrokePath(0.03366*sz,#PB_Path_DiagonalCorner)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure
	Procedure WhiteRook(sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.2167*sz,0.2733*sz)
		AddPathLine(0.2167*sz,0.1567*sz)
		AddPathLine(0.3133*sz,0.1567*sz)
		AddPathLine(0.3133*sz,0.2000*sz)
		AddPathLine(0.4400*sz,0.2000*sz)
		AddPathLine(0.4400*sz,0.1567*sz)
		AddPathLine(0.5600*sz,0.1567*sz)
		AddPathLine(0.5600*sz,0.2000*sz)
		AddPathLine(0.6867*sz,0.2000*sz)
		AddPathLine(0.6867*sz,0.1567*sz)
		AddPathLine(0.7800*sz,0.1567*sz)
		AddPathLine(0.7800*sz,0.2667*sz)
		AddPathLine(0.7100*sz,0.3500*sz)
		AddPathLine(0.7100*sz,0.6567*sz)
		AddPathLine(0.7567*sz,0.7267*sz)
		AddPathLine(0.7567*sz,0.8200*sz)
		AddPathLine(0.8333*sz,0.8200*sz)
		AddPathLine(0.8333*sz,0.8933*sz)
		AddPathLine(0.1667*sz,0.8933*sz)
		AddPathLine(0.1667*sz,0.8200*sz)
		AddPathLine(0.2433*sz,0.8200*sz)
		AddPathLine(0.2433*sz,0.7267*sz)
		AddPathLine(0.2900*sz,0.6567*sz)
		AddPathLine(0.2900*sz,0.3500*sz)
		AddPathLine(0.2133*sz,0.2633*sz)
		Border_White()
		GetFill_White()
		FillPath(#PB_Path_Preserve)
		MovePathCursor(0.2200*sz,0.2767*sz)
		AddPathLine(0.7833*sz,0.2767*sz)
		MovePathCursor(0.2467*sz,0.7267*sz)
		AddPathLine(0.7567*sz,0.7267*sz)
		MovePathCursor(0.2100*sz,0.8200*sz)
		AddPathLine(0.8000*sz,0.8200*sz)
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz,#PB_Path_RoundCorner)
		MovePathCursor(0.2900*sz,0.3400*sz)
		AddPathLine(0.7100*sz,0.3400*sz)
		MovePathCursor(0.2900*sz,0.6500*sz)
		AddPathLine(0.7100*sz,0.6500*sz)
		StrokePath(0.0166*sz,#PB_Path_RoundCorner)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure
	Procedure WhiteBishop(sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)

		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.5000*sz,0.2067*sz)
		AddPathCurve(0.7333*sz,0.2800*sz,0.7900*sz,0.5433*sz,0.6100*sz,0.5867*sz)
		AddPathCurve(0.7167*sz,0.6500*sz,0.7567*sz,0.7700*sz,0.5000*sz,0.7833*sz)
		AddPathCurve(0.6167*sz,0.8733*sz,0.8000*sz,0.7633*sz,0.9033*sz,0.8833*sz)
		AddPathCurve(0.8800*sz,0.9267*sz,0.8500*sz,0.8700*sz,0.7067*sz,0.8833*sz)
		AddPathCurve(0.6367*sz,0.8833*sz,0.5667*sz,0.8933*sz,0.5000*sz,0.8667*sz)
		AddPathCurve(0.4533*sz,0.8833*sz,0.4167*sz,0.8900*sz,0.2933*sz,0.8833*sz)
		AddPathCurve(0.1500*sz,0.8700*sz,0.1300*sz,0.9267*sz,0.1000*sz,0.8833*sz)
		AddPathCurve(0.1500*sz,0.7767*sz,0.3833*sz,0.8667*sz,0.5000*sz,0.7833*sz)
		AddPathCurve(0.1800*sz,0.7700*sz,0.3567*sz,0.5800*sz,0.3900*sz,0.5833*sz)
		AddPathCurve(0.2100*sz,0.5167*sz,0.2667*sz,0.2800*sz,0.5000*sz,0.2067*sz)
		AddPathCircle(0.5000*sz,0.1400*sz,0.0600*sz)
		Border_White()
		GetFill_White()
		FillPath(#PB_Path_Preserve)
		MovePathCursor(0.3867*sz,0.5867*sz)
		AddPathLine(0.6100*sz,0.5867*sz)
		MovePathCursor(0.3167*sz,0.6867*sz)
		AddPathLine(0.6833*sz,0.6867*sz)
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz,#PB_Path_Preserve)
		MovePathCursor(0.4367*sz,0.3867*sz)
		AddPathLine(0.5633*sz,0.3867*sz)
		MovePathCursor(0.5000*sz,0.3233*sz)
		AddPathLine(0.5000*sz,0.4500*sz)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure
	Procedure WhiteKnight(sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.5233*sz,0.1667*sz)
		AddPathCurve(0.8667*sz,0.2133*sz,0.9067*sz,0.5267*sz,0.8933*sz,0.8867*sz)
		AddPathLine(0.3267*sz,0.8867*sz)
		AddPathCurve(0.3000*sz,0.7000*sz,0.5767*sz,0.6667*sz,0.5033*sz,0.4800*sz)
		AddPathCurve(0.4667*sz,0.5167*sz,0.4333*sz,0.5267*sz,0.3767*sz,0.5467*sz)
		AddPathCurve(0.3233*sz,0.5800*sz,0.2800*sz,0.6333*sz,0.2533*sz,0.6967*sz)
		AddPathCurve(0.2200*sz,0.7267*sz,0.1833*sz,0.7000*sz,0.2033*sz,0.6667*sz)
		AddPathCurve(0.1267*sz,0.7167*sz,0.0167*sz,0.6000*sz,0.1533*sz,0.4500*sz)
		AddPathCurve(0.2500*sz,0.3333*sz,0.1667*sz,0.2833*sz,0.2700*sz,0.2167*sz)
		Border_White()
		GetFill_White()
		FillPath(#PB_Path_Preserve)
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		MovePathCursor(0.2867*sz,0.2500*sz)
		AddPathCurve(0.2600*sz,0.2100*sz,0.2433*sz,0.1367*sz,0.2467*sz,0.0867*sz)
		AddPathCurve(0.3000*sz,0.0967*sz,0.3500*sz,0.1300*sz,0.4033*sz,0.1867*sz)
		AddPathCurve(0.4133*sz,0.1567*sz,0.4300*sz,0.1233*sz,0.4600*sz,0.1000*sz)
		AddPathCurve(0.5133*sz,0.1333*sz,0.5233*sz,0.1667*sz,0.5300*sz,0.2333*sz)
		Border_White()
		GetFill_White()
		FillPath(#PB_Path_Preserve)
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		MovePathCursor(0.2067*sz,0.6667*sz)
		AddPathLine(0.2300*sz,0.6267*sz)
		MovePathCursor(0.5033*sz,0.4800*sz)
		AddPathCurve(0.5433*sz,0.4467*sz,0.5400*sz,0.4100*sz,0.5433*sz,0.3667*sz)
		MovePathCursor(0.4000*sz,0.1833*sz)
		MovePathCursor(0.2667*sz,0.3700*sz)
		AddPathCurve(0.2733*sz,0.3400*sz,0.2933*sz,0.3100*sz,0.3200*sz,0.2933*sz)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		AddPathCircle(0.2933*sz,0.3467*sz,0.0233*sz)
		FillPath()
		MovePathCursor(0.1500*sz,0.5933*sz)
		AddPathCurve(0.1467*sz,0.5733*sz,0.1633*sz,0.5533*sz,0.1667*sz,0.5500*sz)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)

		ProcedureReturn result
	EndProcedure
	Procedure WhitePawn(sz.d, gradient.i=0, linecolor.q=$FF000000, fillcolor.q=$FFFFFFFF)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.6033*sz,0.5633*sz)
		AddPathCurve(0.7667*sz,0.6333*sz,0.7800*sz,0.8167*sz,0.7833*sz,0.8933*sz)
		AddPathLine(0.2200*sz,0.8933*sz)
		AddPathCurve(0.2233*sz,0.8167*sz,0.2400*sz,0.6333*sz,0.3933*sz,0.5633*sz)
		AddPathCircle(0.5000*sz,0.4367*sz,0.1600*sz)
		AddPathCircle(0.5000*sz,0.2400*sz,0.1000*sz)

		Border_White()
		GetFill_White()
		FillPath(#PB_Path_Winding)
		AddPathCircle(0.5000*sz,0.2400*sz,0.1067*sz,268,36)
		AddPathCircle(0.5000*sz,0.4367*sz,0.1667*sz,-64,52)
		AddPathCurve(0.7667*sz,0.6333*sz,0.7800*sz,0.8167*sz,0.7833*sz,0.8933*sz)
		AddPathLine(0.2200*sz,0.8933*sz)
		AddPathCircle(0.5000*sz,0.2400*sz,0.1067*sz,272,139,#PB_Path_CounterClockwise)
		AddPathCircle(0.5000*sz,0.4367*sz,0.1667*sz,244,130, #PB_Path_CounterClockwise)
		AddPathCurve(0.2400*sz,0.6333*sz,0.2233*sz,0.8167*sz,0.2200*sz,0.8933*sz)
		AddPathLine(0.7867*sz,0.8933*sz)
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure

	Procedure BlackKing(sz.d, gradient.i=0, linecolor.q=$FFFFFFFF, fillcolor.q=$FF000000)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		;Black Shape & Fill
		MovePathCursor(0.5*sz,0.5*sz)
		AddPathCurve(0.6933*sz,0.0867*sz,1.1400*sz,0.4667*sz,0.7433*sz,0.6633*sz)
		AddPathLine(0.7447*sz,0.8366*sz)
		AddPathCurve(0.6333*sz,0.9100*sz,0.3666*sz,0.9100*sz,0.2533*sz,0.8366*sz)
		AddPathLine(0.2567*sz,0.6633*sz)
		AddPathCurve(-0.1400*sz,0.4667*sz,0.3067*sz,0.0867*sz,0.5*sz,0.5*sz)
		Border_Black()
		GetFill_Black()
		FillPath()
		MovePathCursor(0.4300*sz,0.3900*sz)
		AddPathCurve(0.4333*sz,0.3600*sz,0.3833*sz,0.2600*sz,0.5*sz,0.22*sz)
		AddPathCurve(0.6166*sz,0.2600*sz,0.5666*sz,0.3600*sz,0.5700*sz,0.3900*sz)
		AddPathLine(0.5*sz,0.5*sz)
		AddPathLine(0.4300*sz,0.3900*sz)
		Border_Black()
		GetFill_Black()
		FillPath()
		MovePathCursor(0.5*sz,0.5*sz)
		AddPathLine(0.5*sz,0.6033*sz)
		MovePathCursor(0.5*sz,0.073*sz)
		AddPathLine(0.5*sz,0.22*sz)
		MovePathCursor(0.44*sz,0.121*sz)
		AddPathLine(0.56*sz,0.121*sz)
		Border_Black()
		GetFill_Black()
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		; Light Lines
		MovePathCursor(0.5000*sz,0.5533*sz)
		AddPathCurve(0.6600*sz,0.0867*sz,1.1133*sz,0.4667*sz,0.7367*sz,0.6433*sz)
		MovePathCursor(0.5000*sz,0.5533*sz)
		AddPathCurve(0.3400*sz,0.0867*sz,-0.1067*sz,0.4667*sz,0.2567*sz,0.6433*sz)
		MovePathCursor(0.5*sz,0.55*sz)
		AddPathLine(0.5*sz,0.6033*sz)
		MovePathCursor(0.2533*sz,0.6633*sz)
		AddPathCurve(0.3666*sz,0.5900*sz,0.6333*sz,0.5900*sz,0.7433*sz,0.6633*sz)
		MovePathCursor(0.2533*sz,0.7466*sz)
		AddPathCurve(0.3666*sz,0.6766*sz,0.6333*sz,0.6766*sz,0.7433*sz,0.7433*sz)
		MovePathCursor(0.2533*sz,0.8366*sz)
		AddPathCurve(0.3666*sz,0.7633*sz,0.6333*sz,0.7633*sz,0.7433*sz,0.8366*sz)
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)

		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure
	Procedure BlackQueen(sz.d, gradient.i = 0, linecolor.q=$FFFFFFFF, fillcolor.q = $FF000000)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		;Black Shape & Fill
		MovePathCursor(0.8900*sz,0.2700*sz)
		AddPathArc(0.8333*sz,0.5967*sz,0.8267*sz,0.6067*sz,0.1200*sz)
		AddPathLine(0.7533*sz,0.6867*sz)
		AddPathCurve(0.7433*sz,0.7100*sz,0.7500*sz,0.7333*sz,0.7600*sz,0.7600*sz)
		AddPathCurve(0.7867*sz,0.7733*sz,0.7867*sz,0.7967*sz,0.7800*sz,0.8200*sz)
		AddPathCurve(0.8000*sz,0.8400*sz,0.8067*sz,0.8533*sz,0.7867*sz,0.8767*sz)
		AddPathCurve(0.5933*sz,0.9067*sz,0.4000*sz,0.9067*sz,0.2133*sz,0.8767*sz)
		AddPathCurve(0.1867*sz,0.8600*sz,0.1867*sz,0.8400*sz,0.2133*sz,0.8200*sz)
		AddPathCurve(0.2067*sz,0.8000*sz,0.2067*sz,0.7733*sz,0.2400*sz,0.7600*sz)
		AddPathCurve(0.2533*sz,0.7367*sz,0.2533*sz,0.7100*sz,0.2433*sz,0.6867*sz)
		AddPathArc(0.1633*sz,0.6033*sz,0.1600*sz,0.5767*sz,0.1200*sz)
		AddPathLine(0.1100*sz,0.2700*sz)
		AddPathLine(0.2900*sz,0.5533*sz)
		AddPathLine(0.2900*sz,0.1967*sz)
		AddPathLine(0.4300*sz,0.5433*sz)
		AddPathLine(0.5000*sz,0.1633*sz)
		AddPathLine(0.5700*sz,0.5433*sz)
		AddPathLine(0.7067*sz,0.2000*sz)
		AddPathLine(0.7067*sz,0.5533*sz)
		AddPathLine(0.8900*sz,0.2700*sz)
		AddPathCircle(0.0900*sz,0.2233*sz,0.0500*sz)
		AddPathCircle(0.2900*sz,0.1433*sz,0.0500*sz)
		AddPathCircle(0.5000*sz,0.1133*sz,0.0500*sz)
		AddPathCircle(0.7100*sz,0.1433*sz,0.0500*sz)
		AddPathCircle(0.9067*sz,0.2233*sz,0.0500*sz)
		Border_Black()
		GetFill_Black()
		FillPath(#PB_Path_Preserve)
		StrokePath(0.03366*sz,#PB_Path_DiagonalCorner)
		; Light Lines
		MovePathCursor(0.2100*sz,0.6300*sz)
		AddPathCurve(0.4000*sz,0.5667*sz,0.5900*sz,0.5667*sz,0.7867*sz,0.6300*sz)
		MovePathCursor(0.2567*sz,0.7067*sz)
		AddPathLine(0.7433*sz,0.7067*sz)
		MovePathCursor(0.2333*sz,0.7833*sz)
		AddPathCurve(0.4067*sz,0.8133*sz,0.5867*sz,0.8133*sz,0.7633*sz,0.7833*sz)
		MovePathCursor(0.2033*sz,0.8500*sz)
		AddPathCurve(0.4067*sz,0.8833*sz,0.6033*sz,0.8833*sz,0.7800*sz,0.8500*sz)
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz, #PB_Path_RoundEnd)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure
	Procedure BlackRook(sz.d, gradient.i = 0, linecolor.q=$FFFFFFFF, fillcolor.q = $FF000000)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.2167*sz,0.2733*sz)
		AddPathLine(0.2167*sz,0.1567*sz)
		AddPathLine(0.3133*sz,0.1567*sz)
		AddPathLine(0.3133*sz,0.2000*sz)
		AddPathLine(0.4400*sz,0.2000*sz)
		AddPathLine(0.4400*sz,0.1567*sz)
		AddPathLine(0.5600*sz,0.1567*sz)
		AddPathLine(0.5600*sz,0.2000*sz)
		AddPathLine(0.6867*sz,0.2000*sz)
		AddPathLine(0.6867*sz,0.1567*sz)
		AddPathLine(0.7800*sz,0.1567*sz)
		AddPathLine(0.7800*sz,0.2667*sz)
		AddPathLine(0.7100*sz,0.3500*sz)
		AddPathLine(0.7100*sz,0.6567*sz)
		AddPathLine(0.7567*sz,0.7267*sz)
		AddPathLine(0.7567*sz,0.8200*sz)
		AddPathLine(0.8333*sz,0.8200*sz)
		AddPathLine(0.8333*sz,0.8933*sz)
		AddPathLine(0.1667*sz,0.8933*sz)
		AddPathLine(0.1667*sz,0.8200*sz)
		AddPathLine(0.2433*sz,0.8200*sz)
		AddPathLine(0.2433*sz,0.7267*sz)
		AddPathLine(0.2900*sz,0.6567*sz)
		AddPathLine(0.2900*sz,0.3500*sz)
		AddPathLine(0.2133*sz,0.2633*sz)
		Border_Black()
		GetFill_Black()
		FillPath(#PB_Path_Preserve)
		StrokePath(0.0366*sz,#PB_Path_RoundCorner)
		MovePathCursor(0.2250*sz,0.2767*sz)
		AddPathLine(0.7700*sz,0.2767*sz)
		MovePathCursor(0.2667*sz,0.7267*sz)
		AddPathLine(0.7367*sz,0.7267*sz)
		MovePathCursor(0.2450*sz,0.8200*sz)
		AddPathLine(0.7600*sz,0.8200*sz)
		MovePathCursor(0.2900*sz,0.3400*sz)
		AddPathLine(0.7100*sz,0.3400*sz)
		MovePathCursor(0.2900*sz,0.6700*sz)
		AddPathLine(0.7100*sz,0.6700*sz)
		VectorSourceColor(linecolor)
		StrokePath(0.0240*sz,#PB_Path_RoundEnd)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure
	Procedure BlackBishop(sz.d, gradient.i = 0, linecolor.q=$FFFFFFFF, fillcolor.q = $FF000000)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.5000*sz,0.2067*sz)
		AddPathCurve(0.7333*sz,0.2800*sz,0.7900*sz,0.5433*sz,0.6100*sz,0.5867*sz)
		AddPathCurve(0.7167*sz,0.6500*sz,0.7567*sz,0.7700*sz,0.5000*sz,0.7833*sz)
		AddPathCurve(0.6167*sz,0.8733*sz,0.8000*sz,0.7633*sz,0.9033*sz,0.8833*sz)
		AddPathCurve(0.8800*sz,0.9267*sz,0.8500*sz,0.8700*sz,0.7067*sz,0.8833*sz)
		AddPathCurve(0.6367*sz,0.8833*sz,0.5667*sz,0.8933*sz,0.5000*sz,0.8667*sz)
		AddPathCurve(0.4533*sz,0.8833*sz,0.4167*sz,0.8900*sz,0.2933*sz,0.8833*sz)
		AddPathCurve(0.1500*sz,0.8700*sz,0.1300*sz,0.9267*sz,0.1000*sz,0.8833*sz)
		AddPathCurve(0.1500*sz,0.7767*sz,0.3833*sz,0.8667*sz,0.5000*sz,0.7833*sz)
		AddPathCurve(0.1800*sz,0.7700*sz,0.3567*sz,0.5800*sz,0.3900*sz,0.5833*sz)
		AddPathCurve(0.2100*sz,0.5167*sz,0.2667*sz,0.2800*sz,0.5000*sz,0.2067*sz)
		AddPathCircle(0.5000*sz,0.1400*sz,0.0600*sz)
		Border_Black()
		GetFill_Black()
		FillPath(#PB_Path_Preserve)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		MovePathCursor(0.3867*sz,0.5867*sz)
		AddPathLine(0.6100*sz,0.5867*sz)
		MovePathCursor(0.3167*sz,0.6867*sz)
		AddPathLine(0.6833*sz,0.6867*sz)
		MovePathCursor(0.4367*sz,0.3867*sz)
		AddPathLine(0.5633*sz,0.3867*sz)
		MovePathCursor(0.5000*sz,0.3233*sz)
		AddPathLine(0.5000*sz,0.4500*sz)
		VectorSourceColor(linecolor)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure
	Procedure BlackKnight(sz.d, gradient.i = 0, linecolor.q=$FFFFFFFF, fillcolor.q = $FF000000)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.5233*sz,0.1667*sz)
		AddPathCurve(0.8667*sz,0.2133*sz,0.9067*sz,0.5267*sz,0.8933*sz,0.8867*sz)
		AddPathLine(0.3267*sz,0.8867*sz)
		AddPathCurve(0.3000*sz,0.7000*sz,0.5767*sz,0.6667*sz,0.5033*sz,0.4800*sz)
		AddPathCurve(0.4667*sz,0.5167*sz,0.4333*sz,0.5267*sz,0.3767*sz,0.5467*sz)
		AddPathCurve(0.3233*sz,0.5800*sz,0.2800*sz,0.6333*sz,0.2533*sz,0.6967*sz)
		AddPathCurve(0.2200*sz,0.7267*sz,0.1833*sz,0.7000*sz,0.2067*sz,0.6667*sz)
		AddPathCurve(0.1267*sz,0.7167*sz,0.0167*sz,0.6000*sz,0.1533*sz,0.4500*sz)
		AddPathCurve(0.2500*sz,0.3333*sz,0.1667*sz,0.2833*sz,0.2700*sz,0.2167*sz)
		Border_Black()
		GetFill_Black()
		FillPath(#PB_Path_Preserve)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		MovePathCursor(0.3533*sz,0.2333*sz)
		AddPathCircle(0.3533*sz,0.2333*sz,0.0167*sz,260,50,#PB_Path_CounterClockwise)
		AddPathCurve(0.7667*sz,0.1233*sz,0.8333*sz,0.5100*sz,0.8033*sz,0.8600*sz)
		AddPathLine(0.8767*sz,0.8600*sz)
		AddPathCurve(0.9167*sz,0.2667*sz,0.6333*sz,0.1000*sz,0.3433*sz,0.2200*sz)
		VectorSourceColor(linecolor)
		FillPath()
		MovePathCursor(0.2867*sz,0.2500*sz)
		AddPathCurve(0.2600*sz,0.2100*sz,0.2433*sz,0.1367*sz,0.2467*sz,0.0867*sz)
		AddPathCurve(0.3000*sz,0.0967*sz,0.3500*sz,0.1300*sz,0.4033*sz,0.1867*sz)
		MovePathCursor(0.4033*sz,0.2533*sz)
		AddPathCurve(0.4133*sz,0.1567*sz,0.4300*sz,0.1233*sz,0.4600*sz,0.1000*sz)
		AddPathCurve(0.5133*sz,0.1333*sz,0.5233*sz,0.1667*sz,0.5300*sz,0.2333*sz)
		Border_Black()
		GetFill_Black()
		FillPath(#PB_Path_Preserve)
		StrokePath(0.0366*sz,#PB_Path_RoundEnd)
		MovePathCursor(0.2067*sz,0.6667*sz)
		AddPathLine(0.2300*sz,0.6267*sz)
		MovePathCursor(0.5033*sz,0.4800*sz)
		AddPathCurve(0.5433*sz,0.4467*sz,0.5400*sz,0.4100*sz,0.5433*sz,0.3667*sz)
		MovePathCursor(0.4000*sz,0.1833*sz)
		MovePathCursor(0.2667*sz,0.3700*sz)
		AddPathCurve(0.2733*sz,0.3400*sz,0.2933*sz,0.3100*sz,0.3200*sz,0.2933*sz)
		VectorSourceColor(linecolor)
		StrokePath(0.0267*sz,#PB_Path_RoundEnd)
		AddPathCircle(0.2933*sz,0.3467*sz,0.0233*sz)
		FillPath()
		MovePathCursor(0.1500*sz,0.5933*sz)
		AddPathCurve(0.1467*sz,0.5733*sz,0.1633*sz,0.5533*sz,0.1667*sz,0.5500*sz)
		StrokePath(0.0267*sz,#PB_Path_RoundEnd)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure
	Procedure BlackPawn(sz.d, gradient.i = 0, linecolor.q = $FF000000, fillcolor.q = $FF000000)
		result = CreateImage(#PB_Any, sz, sz, 32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(result))
		MovePathCursor(0.6033*sz,0.5633*sz)
		AddPathCurve(0.7667*sz,0.6333*sz,0.7800*sz,0.8167*sz,0.7833*sz,0.8933*sz)
		AddPathLine(0.2200*sz,0.8933*sz)
		AddPathCurve(0.2233*sz,0.8167*sz,0.2400*sz,0.6333*sz,0.3933*sz,0.5633*sz)
		AddPathCircle(0.5000*sz,0.4367*sz,0.1600*sz)
		AddPathCircle(0.5000*sz,0.2400*sz,0.1000*sz)
		VectorSourceColor($ff000000)

		Border_Black()
		GetFill_Black()
		FillPath(#PB_Path_Winding)
		AddPathCircle(0.5000*sz,0.2400*sz,0.1067*sz,268,36)
		AddPathCircle(0.5000*sz,0.4367*sz,0.1667*sz,-64,52)
		AddPathCurve(0.7667*sz,0.6333*sz,0.7800*sz,0.8167*sz,0.7833*sz,0.8933*sz)
		AddPathLine(0.2200*sz,0.8933*sz)
		AddPathCircle(0.5000*sz,0.2400*sz,0.1067*sz,272,139,#PB_Path_CounterClockwise)
		AddPathCircle(0.5000*sz,0.4367*sz,0.1667*sz,244,130, #PB_Path_CounterClockwise)
		AddPathCurve(0.2400*sz,0.6333*sz,0.2233*sz,0.8167*sz,0.2200*sz,0.8933*sz)
		AddPathLine(0.7867*sz,0.8933*sz)
		StrokePath(0.0366*sz)
		StopVectorDrawing()
		ProcedureReturn result
	EndProcedure

	Procedure ChessBoardWhitePlayer(size.i, color1.i, color2.i)
		Protected ret.i, p.d=size
		Shared w.d, h.d
		ret = CreateImage(#PB_Any, size, size,32, #PB_Image_Transparent)
		StartVectorDrawing(ImageVectorOutput(ret))

		squareids    = LoadFont(#PB_Any, "Arial", 11, #PB_Font_Bold)
		squarestamps = LoadFont(#PB_Any, "verdana", 10)

		VectorSourceColor(color2)
		AddPathBox(0, 0, size, size)
		FillPath()
		MovePathCursor(0,0)
		AddPathBox(0, 0, size, size)
		VectorSourceColor($ff000000)
		StrokePath(2)

		VectorSourceColor(color1)
		MovePathCursor(0,0)
		AddPathBox(0.04*p,0.04*p,0.92*p,0.92*p)
		StrokePath(0.0075*p)
		AddPathBox(0.05*p, 0.05*p,0.90*p, 0.90*p)
		StrokePath(0.004*p)
		x.d = 0.05*p : y.d = 0.05*p : yy.d = y
		w.d = (p-(0.05*p)*2)/8 : h.d = w

		For i=1 To 4
			AddPathBox(x+w,yy,w,h)
			AddPathBox(x+w*3,yy,w,h)
			AddPathBox(x+w*5,yy,w,h)
			AddPathBox(x+w*7,yy,w,h)
			yy+h
			AddPathBox(x,yy,w,h)
			AddPathBox(x+w*2,yy,w,h)
			AddPathBox(x+w*4,yy,w,h)
			AddPathBox(x+w*6,yy,w,h)
			yy+h
		Next

		VectorSourceColor(color1)
		FillPath()

		For j=1 To 8
			For i=1 To 8
				With squares(Chr(j+96)+Str(i))
					\id = Chr(j+96)+Str(i)
					\x = x + w * (j-1)
					\y = y + h * (8-i)
				EndWith
			Next
		Next

		;       ForEach squares()
		;         text$ = squares()\id
		;         MovePathCursor(squares()\x,squares()\y)
		;         VectorFont(FontID(squarestamps))
		;         VectorSourceColor(RGBA(0,0,0,255))
		;         DrawVectorText(text$)
		;       Next

		VectorFont(FontID(squareids), p/36)
		y=0.05*p + h/2 - p/64
		For i=8 To 1 Step -1
			MovePathCursor(p*0.012, y)
			DrawVectorText(Str(i))
			MovePathCursor((p-p*0.012)-VectorTextWidth(Str(i)), y)
			DrawVectorText(Str(i))
			y+h
		Next

		x=0.05*p + w/2 - VectorTextWidth("A")/2
		y=p-p*0.003-VectorTextHeight("A")
		For i=97 To 104
			MovePathCursor(x, y)
			DrawVectorText(Chr(i))
			MovePathCursor(x, p*0.0035)
			DrawVectorText(Chr(i))
			x+w
		Next

		ProcedureReturn ret

	EndProcedure
	Procedure ChessBoardBlackPlayer(size.i, color1.i, color2.i)
		Protected ret.i, p.d=size

		ret = CreateImage(#PB_Any, size, size)
		StartVectorDrawing(ImageVectorOutput(ret))

		squareids    = LoadFont(#PB_Any, "Arial", 11, #PB_Font_Bold)
		squarestamps = LoadFont(#PB_Any, "verdana", 10)

		VectorSourceColor(color2)
		AddPathBox(0, 0, size, size)
		FillPath()
		MovePathCursor(0,0)
		AddPathBox(0, 0, size, size)
		VectorSourceColor(RGBA(0,0,0,255))
		StrokePath(2)

		VectorSourceColor(color1)
		MovePathCursor(0,0)
		AddPathBox(0.04*p,0.04*p,0.92*p,0.92*p)
		StrokePath(0.0075*p)
		AddPathBox(0.05*p, 0.05*p,0.90*p, 0.90*p)
		StrokePath(0.004*p)
		x.d = 0.05*p : y.d = 0.05*p
		w.d = (p-(0.05*p)*2)/8 : h.d = w

		For i=1 To 4
			AddPathBox(x+w,y,w,h)
			AddPathBox(x+w*3,y,w,h)
			AddPathBox(x+w*5,y,w,h)
			AddPathBox(x+w*7,y,w,h)
			y+h
			AddPathBox(x,y,w,h)
			AddPathBox(x+w*2,y,w,h)
			AddPathBox(x+w*4,y,w,h)
			AddPathBox(x+w*6,y,w,h)
			y+h
		Next
		VectorSourceColor(color1)
		FillPath()

		For j=8 To 1 Step -1
			For i=8 To 1 Step -1
				With squares(Chr(j+96)+Str(i))
					\id = Chr(j+96)+Str(i)
					\x = x + w * (8-j)
					\y = y + h * (i-9)
				EndWith
			Next
		Next

		;       ForEach squares()
		;         text$ = squares()\id
		;         MovePathCursor(squares()\x,squares()\y)
		;         VectorFont(FontID(squarestamps))
		;         VectorSourceColor(RGBA(0,0,0,255))
		;         DrawVectorText(text$)
		;       Next

		VectorFont(FontID(squareids), p/36)
		y=0.05*p + h/2 - p/64
		For i=1 To 8
			MovePathCursor(p*0.012, y)
			DrawVectorText(Str(i))
			MovePathCursor((p-p*0.012)-VectorTextWidth(Str(i)), y)
			DrawVectorText(Str(i))
			y+h
		Next

		x=0.05*p + w/2 - VectorTextWidth("A")/2
		y=p-p*0.003-VectorTextHeight("A")
		For i=104 To 97 Step -1
			MovePathCursor(x, y)
			DrawVectorText(Chr(i))
			MovePathCursor(x, p*0.0035)
			DrawVectorText(Chr(i))
			x+w
		Next

		ProcedureReturn ret

	EndProcedure

EndModule

;Test:

UseModule ChessAssets
	board = ChessBoardWhitePlayer(600, $FFb7866e, $FFfcfdf8)

	z=4;	1=no border, 2=10 border width
	wk = WhiteKing  (w,z)
	wq = WhiteQueen (w,z)
	wr = WhiteRook  (w,z)
	wb = WhiteBishop(w,z)
	wn = WhiteKnight(w,z)
	wp = WhitePawn  (w,z)
	bk = BlackKing  (w,z)
	bq = BlackQueen (w,z)
	br = BlackRook  (w,z)
	bb = BlackBishop(w,z)
	bn = BlackKnight(w,z)
	bp = BlackPawn  (w,z)

	StartDrawing(ImageOutput(board))
	DrawAlphaImage(ImageID(wk),squares("e1")\x,squares("e1")\y)
	DrawAlphaImage(ImageID(wq),squares("d1")\x,squares("e1")\y)
	DrawAlphaImage(ImageID(wb),squares("c1")\x,squares("e1")\y)
	DrawAlphaImage(ImageID(wn),squares("b1")\x,squares("e1")\y)
	DrawAlphaImage(ImageID(wr),squares("a1")\x,squares("e1")\y)
	DrawAlphaImage(ImageID(wb),squares("f1")\x,squares("e1")\y)
	DrawAlphaImage(ImageID(wn),squares("g1")\x,squares("e1")\y)
	DrawAlphaImage(ImageID(wr),squares("h1")\x,squares("e1")\y)
	For i=97 To 104
		DrawAlphaImage(ImageID(wp),squares(Chr(i)+"2")\x,squares(Chr(i)+"2")\y)
	Next
	DrawAlphaImage(ImageID(bk),squares("e8")\x,squares("e8")\y)
	DrawAlphaImage(ImageID(bq),squares("d8")\x,squares("e8")\y)
	DrawAlphaImage(ImageID(bb),squares("c8")\x,squares("e8")\y)
	DrawAlphaImage(ImageID(bn),squares("b8")\x,squares("e8")\y)
	DrawAlphaImage(ImageID(br),squares("a8")\x,squares("e8")\y)
	DrawAlphaImage(ImageID(bb),squares("f8")\x,squares("e8")\y)
	DrawAlphaImage(ImageID(bn),squares("g8")\x,squares("e8")\y)
	DrawAlphaImage(ImageID(br),squares("h8")\x,squares("e8")\y)
	For i=97 To 104
		DrawAlphaImage(ImageID(bp),squares(Chr(i)+"7")\x,squares(Chr(i)+"7")\y)
	Next
	StopDrawing()

	OpenWindow(0,0,0,ImageWidth(board),ImageHeight(board),"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
	ImageGadget(0,0,0,0,0,ImageID(board))
	Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
Post Reply