[Free] CompCreator - create component dynamically

Can you share your template json in full (the one that generates the extra padding) Let us see if it is a device specific thing ?

@TIMAI2

{
"$components": [{
	"$Name": "HorizontalArrangement31",
	"$Type": "HorizontalArrangement",
	"$Version": "4",
	"AlignHorizontal": "3",
	"AlignVertical": "2",
	"BackgroundColor": "&HFFCCCCCC",
	"Width": "-2",
	"Uuid": "414377418",
	"$Components": [{
			"$Name": "Label1",
			"$Type": "Label",
			"$Version": "5",
			"BackgroundColor": "&HFFFFFFFF",
			"HasMargins": "False",
			"Width": "-1030",
			"Text": "{1}",
			"Uuid": "-655415227"
		}, {
			"$Name": "Label2",
			"$Type": "Label",
			"$Version": "5",
			"BackgroundColor": "&HFFFFFFFF",
			"HasMargins": "False",
			"Width": "-1010",
			"Text": "{2}",
			"Uuid": "-271615762"
		}, {
			"$Name": "Label3",
			"$Type": "Label",
			"$Version": "5",
			"BackgroundColor": "&HFFFFFFFF",
			"HasMargins": "False",
			"Width": "-1010",
			"Text": "{3}",
			"Uuid": "-180627646"
		}, {
			"$Name": "Label4",
			"$Type": "Label",
			"$Version": "5",
			"BackgroundColor": "&HFFFFFFFF",
			"HasMargins": "False",
			"Width": "-1030",
			"Text": "{4}",
			"Uuid": "1095561169"
		}, {
			"$Name": "CheckBox1",
			"$Type": "CheckBox",
			"$Version": "2",
			"BackgroundColor": "&HFFFFFFFF",
			"Checked": "{5}",
			"Uuid": "753841863"
		}
	]
}
],
"$blocks": []
}

Gives me that:

compcr6

Labels are 30% 10% 10% 30% CB is Height & Width auto, no text fonts 14px.

Rows are created inside a verticalarrangement:

{
    "$components": [{
            "$Name": "VerticalArrangementDynamicTable",
            "$Type": "VerticalArrangement",
            "$Version": "4",
            "AlignHorizontal": "3",
            "BackgroundColor": "&HFFFFFFFF",
            "Width": "-2",
            "Uuid": "9941220"
        }
    ],
    "$blocks": []
}

I'm using memu play, tried tablet and phone sizes, no difference.

Just discovered, if I leave the Checkbox out, I get what I want! :flushed:

compcr7

Maybe I should use switches instead of Checkboxes, or is there a way to get smaller Checkboxes? (setting the fontsize of CB's does nothing)

compcr8

Should have asked that question in the first place, we could have got there much more quickly :wink:

You could try toggle buttons, a bit more code needed but might work....

Yes, sorry for my lengthy posts, but it really puzzled me why this was happening.
I don't know if it is of any use for anyone here, so if you want I will delete all my posts?

Anyway, everyone's quick responses are much appreciated!

@TIMAI2

Fiddling around with switch now.
When I replace the checkbox with a switch

{
"$Name": "Switch1",
"$Type": "Switch",
"$Version": "1",
"On": "{5}",
"Uuid": "-2041829252"
}

it gives an error:

compcr9

Maybe I discovered a bug?

It says "Swith" instead of "Switch"!?
compcr10

1 Like

Just replace that block with a text block contains Switch

@Kevinkun will be alerted :wink:

Not using that block, using the template, see above.

yes its a typo, need to be fixed.
but I am away from my computer and i can fix this on Wednesday.

In V8, there is a scenario where deletion fails:

Add some dynamic Sprites, record them in a List specifically for dynamic sprites only.

  1. Delete the Sprites via a loop through the List - success
  2. Disable the Sprites (stop the User from moving them inadvertently when painting). Delete the Sprites via a loop through the List - success
  3. Disable the Sprites (stop the User from moving them inadvertently when painting). Paint anywhere on the Canvas. Delete the Sprites via a loop through the List - fail:
    Snap1
1 Like

How are you disabling the sprites (there is no enabled property for a real sprite), but you can use the enabled property with the dynamic settings?

You can make the Sprite Property settings available by having a single hidden on-dynamic sprite on the Canvas.

Since reporting the bug, I can't reproduce it with unchanged code!

Snap2

Sorry ignore me, just spotted the enabled checkbox :upside_down_face:

You do not need a hidden real sprite, you can just use the component setter:

image

I too cannot reproduce your reported problem

.... I'm not using CompCreator to set the property - maybe that is why my code failed.

Edit.... but then that can't be 'it' since the dynamic sprite has to work with all the regular sprite functions such as drag - and does so perfectly.

Well, I had tested this over and over as I tried to find a work-around before reporting it, but since reporting it, there has been no issue at all :zipper_mouth_face:

false alarm :rofl:

It occurred for over an hour, but it hasn't occurred since. Can't be deemed as a false alarm as we don't know why it started or why it stopped.

fixed, please update the extension.

I did the same, but got no error.

2 Likes

Same for me, but in the process found a lot of weakness in AI2's sprites :grin:

is this extension still available? the download link seems unavailable. es there a mirror for downloading? thx in advance