xyz No... i hate working with dictionaries and arrays in this situation, and i wish i didnt had to do this...
the dictionary values ive showed it above... I cant really rebember anymore but i will try...
I had to make "Lnum" an array so i could use multiple layers:
Lnum[0]: layer 0
Lnum[1]: layer 1
and so on...
"Lnum" adds more values( layers[] ) right at the beginning, This is done in the inpector plugIN, with the itemList
var listSize = itmListLayer.get_item_count();
for n in range( listSize-1 ):
if ( PlugTileDrawNode.layers.Lnum.size() < listSize ):
PlugTileDrawNode.layers.Lnum.append( {} );
it looks like this:
var layers = {
'Lnum': [ {},{},{} ] # itemList has 3 items
}
the dictionary inside the array: Holds the vector2 coordinates ( its the key "cords" ) and the value ( "img" ) its a 32x32 image.
The dictionary is being filled on 1 go ( 1 mouse click )
for i in range(0, drawText.get_image().get_size().x,32 ):
for j in range(0, drawText.get_image().get_size().y, 32):
mouseGroup.Fnum.append( { "cords": Vector2(i, j), "img": ImageTexture.create_from_image(drawText.get_image().get_region( Rect2( i, j, 32, 32) ) ) } )
Its very dificult to understand but that last part "img": its the value inside the dictionary
print( layers.Lnum );
[{ (128, 96): <ImageTexture#-9223369173520790977>, (128, 128): <ImageTexture#-9223369173470459328>, (128, 160): <ImageTexture#-9223369173420127679>, (128, 192): <ImageTexture#-9223369173369796030>, (128, 224): <ImageTexture#-9223369173319464381>, (160, 96): <ImageTexture#-9223369172816147891>, (160, 128): <ImageTexture#-9223369172765816242>, (160, 160): <ImageTexture#-9223369172715484593>, (160, 192): <ImageTexture#-9223369172665152944>, (160, 224): <ImageTexture#-9223369172614821295>, (192, 96): <ImageTexture#-9223369172111504805>, (192, 128): <ImageTexture#-9223369172061173156>, (192, 160): <ImageTexture#-9223369172010841507>, (192, 192): <ImageTexture#-9223369171960509858>, (192, 224): <ImageTexture#-9223369171910178209>, (224, 96): <ImageTexture#-9223369171406861719>, (224, 128): <ImageTexture#-9223369171356530070>, (224, 160): <ImageTexture#-9223369171306198421>, (224, 192): <ImageTexture#-9223369171255866772>, (224, 224): <ImageTexture#-9223369171205535123>, (128, 256): <ImageTexture#-9223369173269132732>, (128, 288): <ImageTexture#-9223369173218801083>, (128, 320): <ImageTexture#-9223369173168469434>, (160, 256): <ImageTexture#-9223369172564489646>, (160, 288): <ImageTexture#-9223369172514157997>, (160, 320): <ImageTexture#-9223369172463826348>, (192, 256): <ImageTexture#-9223369171859846560>, (192, 288): <ImageTexture#-9223369171809514911>, (192, 320): <ImageTexture#-9223369171759183262>, (224, 256): <ImageTexture#-9223369171155203474>, (224, 288): <ImageTexture#-9223369171104871825>, (224, 320): <ImageTexture#-9223369171054540176>, (64, 96): <ImageTexture#-9223369174930077374>, (64, 128): <ImageTexture#-9223369174879745615>, (64, 160): <ImageTexture#-9223369174829413972>, (64, 192): <ImageTexture#-9223369174779082323>, (64, 224): <ImageTexture#-9223369174728750674>, (64, 256): <ImageTexture#-9223369174678419025>, (64, 288): <ImageTexture#-9223369174628087643>, (64, 320): <ImageTexture#-9223369174577755723>, (64, 352): <ImageTexture#-9223369174527424361>, (64, 384): <ImageTexture#-9223369174477092308>, (64, 416): <ImageTexture#-9223369174426760659>, (64, 448): <ImageTexture#-9223369174376429010>, (64, 480): <ImageTexture#-9223369174326097361>, (64, 512): <ImageTexture#-9223369174275765712>, (96, 96): <ImageTexture#-9223369174225434063>, (96, 128): <ImageTexture#-9223369174175102414>, (96, 160): <ImageTexture#-9223369174124770765>, (96, 192): <ImageTexture#-9223369174074439116>, (96, 224): <ImageTexture#-9223369174024107467>, (96, 256): <ImageTexture#-9223369173973775818>, (96, 288): <ImageTexture#-9223369173923444169>, (96, 320): <ImageTexture#-9223369173873112520>, (96, 352): <ImageTexture#-9223369173822780871>, (96, 384): <ImageTexture#-9223369173772449222>, (96, 416): <ImageTexture#-9223369173722117573>, (96, 448): <ImageTexture#-9223369173671785924>, (96, 480): <ImageTexture#-9223369173621454275>, (96, 512): <ImageTexture#-9223369173571122626>, (128, 352): <ImageTexture#-9223369173118137785>, (128, 384): <ImageTexture#-9223369173067806136>, (128, 416): <ImageTexture#-9223369173017474487>, (128, 448): <ImageTexture#-9223369172967142838>, (128, 480): <ImageTexture#-9223369172916811189>, (128, 512): <ImageTexture#-9223369172866479540>, (160, 352): <ImageTexture#-9223369172413494699>, (160, 384): <ImageTexture#-9223369172363163050>, (160, 416): <ImageTexture#-9223369172312831401>, (160, 448): <ImageTexture#-9223369172262499752>, (160, 480): <ImageTexture#-9223369172212168103>, (160, 512): <ImageTexture#-9223369172161836454>, (192, 352): <ImageTexture#-9223369171708851613>, (192, 384): <ImageTexture#-9223369171658519964>, (192, 416): <ImageTexture#-9223369171608188315>, (192, 448): <ImageTexture#-9223369171557856666>, (192, 480): <ImageTexture#-9223369171507525017>, (192, 512): <ImageTexture#-9223369171457193368>, (224, 352): <ImageTexture#-9223369171004208527>, (224, 384): <ImageTexture#-9223369170953876878>, (224, 416): <ImageTexture#-9223369170903545229>, (224, 448): <ImageTexture#-9223369170853213580>, (224, 480): <ImageTexture#-9223369170802881931>, (224, 512): <ImageTexture#-9223369170752550282>, (256, 96): <ImageTexture#-9223369170702218633>, (256, 128): <ImageTexture#-9223369170651886984>, (256, 160): <ImageTexture#-9223369170601555335>, (256, 192): <ImageTexture#-9223369170551223686>, (256, 224): <ImageTexture#-9223369170500892037>, (256, 256): <ImageTexture#-9223369170450560388>, (256, 288): <ImageTexture#-9223369170400228739>, (256, 320): <ImageTexture#-9223369170349897090>, (256, 352): <ImageTexture#-9223369170299565441>, (256, 384): <ImageTexture#-9223369170249233792>, (256, 416): <ImageTexture#-9223369170198902143>, (256, 448): <ImageTexture#-9223369170148570494>, (256, 480): <ImageTexture#-9223369170098238845>, (256, 512): <ImageTexture#-9223369170047907196>, (288, 96): <ImageTexture#-9223369169997575547>, (288, 128): <ImageTexture#-9223369169947243898>, (288, 160): <ImageTexture#-9223369169896912249>, (288, 192): <ImageTexture#-9223369169846580600>, (288, 224): <ImageTexture#-9223369169796248951>, (288, 256): <ImageTexture#-9223369169745917302>, (288, 288): <ImageTexture#-9223369169695585653>, (288, 320): <ImageTexture#-9223369169645254004>, (288, 352): <ImageTexture#-9223369169594922355>, (288, 384): <ImageTexture#-9223369169544590706>, (288, 416): <ImageTexture#-9223369169494259057>, (288, 448): <ImageTexture#-9223369169443927408>, (288, 480): <ImageTexture#-9223369169393595759>, (288, 512): <ImageTexture#-9223369169343264110>, (320, 96): <ImageTexture#-9223369169292932461>, (320, 128): <ImageTexture#-9223369169242600812>, (320, 160): <ImageTexture#-9223369169192269163>, (320, 192): <ImageTexture#-9223369169141937514>, (320, 224): <ImageTexture#-9223369169091605865>, (320, 256): <ImageTexture#-9223369169041274216>, (320, 288): <ImageTexture#-9223369168990942567>, (320, 320): <ImageTexture#-9223369168940610918>, (320, 352): <ImageTexture#-9223369168890279269>, (320, 384): <ImageTexture#-9223369168839947620>, (320, 416): <ImageTexture#-9223369168789615971>, (320, 448): <ImageTexture#-9223369168739284322>, (320, 480): <ImageTexture#-9223369168688952673>, (320, 512): <ImageTexture#-9223369168638621024> }, **{ }, { }**] layers 1 and 2 are empty i frogot to drawn something on them before making the print
I couldnt get this working any other way, by just using tiles i would not be able to add effects like Blur... Its has simple has in photoshop: You blur the image 50%, save it to png, open the image again and select pieces(32x32) of that image, and each piece transforms into a brush.. Then you draw with that brush.