[F/OS] - Dynamic Components Extension (for every component) 2.3.0

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.

2 Likes

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.

If I used the ImageSprite speed instead of Ball speed setter, it returns the expected error.

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 this Class 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:

  1. Balls and ImageSprites created with the extension do not move even when speed is > 0.

  2. 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 :slightly_smiling_face:

I already changed the behavior of SetProperty for v1.2, can you try with the new version which I will sent it from DM?

1 Like

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 :sweat_smile:, so here is the new release!

  • New Block UsedIDs
    Returns all used IDs that you used in Create block. As Boban suggested! :raised_hands:

    component_method(1)

  • 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! :raised_hands:

    component_method(2)

  • 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 :crazy_face:).
    And thanks to Italo for helps me for testing it! :raised_hands:

  • 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. :sweat_smile:

  • 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 the componentName parameter and extension will create another instance of it! Don’t worry you can still use the old method!


:warning: 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.

14 Likes

After The Update I can’t set the get component block in any component block to change properties.

2 Likes

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.

2 Likes

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.

2 Likes

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.

9 Likes

.
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.

@paska_ig
Try to tick Clickable in Designer screen.

Clickability is assigned when the component is created.


Only a long click doesn’t work. Short works well