I donât think this works because the Ball component doesnât have itâs own X
property, it inherits it from the Sprite component.
This is the only configuration that doesnât generate an error.
The ball is created, it is placed in random x and y but it remain static even though the speed is not 0.
I donât think so, I use getMethods()
method to get the methods for the component.
According to Java docs:
Returns an array containing
Method
objects reflecting all the public methods of the class or interface represented by thisClass
object, including those declared by the class or interface and those inherited from superclasses and superinterfaces.
Can you try if this happens for the static component too?
Yes, doing this, the ball created in the designer starts moving.
I tried with dynamic ImageSprite too and they donât move when speed is > 0 but Heading works fine.
The blocks SetProperty from your extension do not seem to work with elements inside the canvas. Thanks for checking this.
So, to make it short:
-
Balls and ImageSprites created with the extension do not move even when speed is > 0.
-
The blocks SetProperty return an error when trying to set Ball or ImageSprite properties.
Thatâs so weird. I will check what is going wrong. Thanks
I already changed the behavior of SetProperty for v1.2, can you try with the new version which I will sent it from DM?
Version 1.2
Looks like a month (or maybe more) has been passed from the previous release. So sorry for waiting long for a new release because I had other jobs to do first , so here is the new release!
-
New Block
UsedIDs
Returns all used IDs that you used inCreate
block. As Boban suggested! -
New Block
ChangeId
Changes the used ID to a new one. After changing the ID, old ID will be invalid forever. As yoni_mic suggested! -
Removed Block
RemoveAll
Sadly, this block was causing a weird error that I canât solve, and it would be better to use this method instead of having a buggy block:You need to use a
for each
loop together with the UsedIDs block to remove all components. -
Bug Fix
SetProperty
block is much stable anymore!
Because it supports numbers too! And I made some tweaks to it, so it doesnât cause any casting errors anymore (until someone reports it ).
And thanks to Italo for helps me for testing it! -
Enhancement Implemented ProGuard to decrease extension size
I know it wonât have any effect on it as extension is open source, I just built with it to decrease the extension size. -
Enhancement
Create
block now supports creating from existing component!
Now you donât need to learn the internal name of the component anymore! Just add a current static component block to thecomponentName
parameter and extension will create another instance of it! Donât worry you can still use the old method!
Migration Warning
As these things have been changed, you may need to change the blocks that you used.
- SetProperty blockâs parameter names have been changed.
- As RemoveAll block has been removed, you wonât able to use it again.
I updated the first post. You can go to the top of the page for download links.
Yes, that block now doesnât accept the extension one.
And the SetProperty blocks are still returning an error when trying to use them:
You can put the component in a variable and then use the variable as a workaround for now.
Anyways, the speed is still accepted this way but the created ball doesnât move. Only the ones created with the designer.
NYC update but problem in setting the property by any component
Sorry, that was because I changed the parameter types to Component instead of Object. I will release a fix today.
You can now use Speed in SetProperty block. But X and Y needs to be set from Any Component blocks. I will check what is going wrong.
Edit: It works like this.
Edit 2: It also works like this.
Hi in this new version can I delete the image sprites or not yet?
Did you used Remove block?
Version 1.2.1
I released a small fix for GetComponent
's return type and updated the first post, thanks and sorry about it!
You can go to the top of the page for download links.
Long click doesnât work. Does it make sense to look for a solution, or does it really not work?
Sorry for the automatic translation.