I want to make a chess game with chess pieces that have custom player drawn banners on them for your own unique looking army but all of the character customization is for premade sprites, any idea how to do this or a video that does?
Custom Chess pieces
Gillan this might be helpful for me i'm unsure i'll have to check https://docs.godotengine.org/en/stable/tutorials/2d/custom_drawing_in_2d.html
- Edited
Gillan you can automate drawing (overriding the _draw
function) with a set of instructions.
you put instructions in arrays, for example, an array for boxes, and then loop them and draw each box. although an array of dictionaries would allow you to put more data like color and line width.
each time a shape is created by the player, you add it to the dictionary, and then in the draw
it loops through each and draws.
this will have advantages and disadvantages, like a limited number of shapes, and only being able to draw shapes.
but you could save the result to an image and then load that image.
var draw_squares : Array[Dictionary] = [{"rect" : Rect(0.0, 0.0, 16.0, 16.0), "color" : Color(0.0, 0.2, 1.0, 1.0), "fill" : true}]
func _draw():
for i in draw_squares:
draw_rect(i.get("rect", Rect(0.0, 0.0, 16.0, 16.0)), i.get("color", Color.WHITE), i.get("fill", false))
#for j in draw_lines:
#for k in draw_circles:
#for l in draw_text
#etc
if you want to draw pixels, that's more difficult.
edit: you can use a Viewport and save the image:
https://docs.godotengine.org/en/stable/classes/class_viewport.html#class-viewport-method-get-texture
Jesusemora its good kind of like the cod emblem designer, but i think i'll go with uploading images via a pixel art app called pixel studio. made me think of another idea to do with pixel studio, what should the banner size be, probably a full image area in pixel studio since you can have image areas defined like 32x32 64x32 and such