Hi I just want to draw multiple lines just like we do in MS paint, May be this can be achieved with primitive drawing plugin
There is an example about drawing system in the examples folder, basically, when you draw a shape a new structure variable is saved with the info of the draw, for lines the info should be the start point, the end point, the color and the thickness. Then iterate over the structure that stores all the lines and draw them
Maybe the example is a bit over-complex, because the little GUI and multiple shape types…
Yes i got the example, but it’s complex.
What going on in example is that “on every shape draw store it’s all properties (startPoint, endPoint, thickness etc…) then store that share structure and repeat then iterate over all the shapes and draw again and again in infinite loop”
Is it that happening??
How to create new instance of structure?
How to Iterated among all the structure of shapes and draw on screen?
Will that process not slow down the drawing?
Yes, it’s what I told you in my previous message, but it is not an infinite loop, it is a Repeat X times event
If you have the variable Shapes, the action “Do = ‘Line’ to variable Shapes.0.Type” will generate all the necessary structure:
Shapes
|...0
|...Type = "Line"
I usually use an extra variable inside the structure to get the structure size, plus variables to iterate have iterable names (numbers), a structure example that you can iterate over:
Shapes
|...0
|...Type = "Line"
|...StartPointX = 10
|...
|...EndPointY = 20
|...1
|...
|...2
|...
|...Size = 3
Then you can do it (the variable i is a counter to access each child) :
[code]Conditions: No conditions
Actions: Do = 0 to variable i
Repeat Variable(Shapes.Size) times
…Conditions: No conditions
…Actions: Draw the shape Shapes[VariableString(i)]
Do + 1 to variable i[/code]
This is the fastest way I can think, you just save the main info in lightweight entities as the structures
Thanks for you concrete information, I got the point .
Are u a contributor to G-develop? I’ll soon contribute in making plugin for G-develop and spread the word.
I hope so you’ll remain with me and help me out in making this game.
Note: This game will be awesome believe me