A Center [actor] with [actor] block. PLEASE

Rainbros

  • Posts: 175
It is incredibly time-wasting to manually add half-widths and whatnot just to get spawned actors to line up right. We need a block for this, which might also include other useful options like left and right-align. Stencyl needs some serious workflow improvements.

LIBERADO

  • *
  • Posts: 2719
I totally agree.
I would like to see these options in this block: 

Such options would be very useful and frequently used, undoubtedly.

« Last Edit: February 20, 2016, 03:14:30 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

yoplalala

  • *
  • Posts: 1633
If you want you can try my not published extension. It was meant as a replacement  to the scaling utilities extensions ( so that's why if you install it save you game before, install  my extension, remove scaling utilities), as it didn't work for actorsthat didn't their origin points a the centre. I added little by little plenty of blocks. I'll publish it maybe as a real extension later, when it'll be clean.


All the blocks

getScale : get scale percentage for actor
scaledCoord
setScaledCoord
offset : coordinates for scaled points
scale:  Scale in percentage
setScale: Scale in pixel, keeping ratios or not
scaledSize : in pixels
isScaled:
setRealSize: Set real size (not scaled size) useful when actor is attached to image instance  ( not tested with collisions, shouldn't work)
setHeightAndWidth :  Grow size depending on point   ( made to bypass the grow system which doesn't work when actor is set to not move)

fitActorInRectangle:  change actor's size so that it fits into a rectangle. If can grow, it will be able to grow the actor
  SHOULDN'T WORK YET

getOriginPointActor :  current origin point for actor
setOriginPointActor :  set current origin point for actor. After the tween block, you have to set it the old one because of bugs with collisions

setXActor  :  scaled/non scaled   x-left, x-right, x-middle  from bottom/middle/top of screen    ( in the future,  scene and camera too)
setYActor  :  scaled/non scaled   y-top, y_middle, y_left  from bottom/middle/top of screen    ( in the future,  scene and camera too)

getSizeActorType :  actor type size

setXActorFromActor
setYActorFromActor
destroyActor : destory actor, don't recycle it,  must be used with  actors created with  createActorFromImgInst

createActorFromImgInst:  create actor from img inst   ( not tested with collisions, shouldn't work)
isActorInsideActor : returns percentage of  actor inside bigger actor
 
Hopefully, it will give inspiration to Stencyl devs ;)


If ever any of you have ideas for future blocks, tell me :)

« Last Edit: February 24, 2016, 07:18:08 am by yoplalala »

LIBERADO

  • *
  • Posts: 2719
Hey @yoplalala, does your sentence "SHOULDN'T WORK YET" refers to all blocks under it until the end of your post?

« Last Edit: March 03, 2016, 06:52:19 am by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

yoplalala

  • *
  • Posts: 1633
No sorry just the block  fitActorInRectangle.
Maybe be ratioed width/height too ( but these should be easy to correct).

It's a work in progress, so if you have any bugs/ideas for blocks tell me. I constantly use most of the blocks on my game (1X and mostly simple physics)

specially the set x /y ones, it saves plenty of time
and create actor from img instance, which makes an actor the size of an image instance so that the image isn't modified by the scale ( I would love to improve this one , so the collisions would also be the size of the image instance, and have looked into the engine, and I don't understand how collisions work in simple physics .
 



LIBERADO

  • *
  • Posts: 2719
Ah, ok. Then, can I safety replace the Scaling Utilities extension with this one?
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

yoplalala

  • *
  • Posts: 1633
I would still encourage to save it, we never know. But I can tell you I did it without problems, and was checking for this problem , when I first started this extension. But wait five minutes, I 'll check if the xml block names are indeed the same and tell you.

yoplalala

  • *
  • Posts: 1633
Hmm, the get scale and set scale block could cause problems  as the order is mixed :( . If you want I could put a new version which will be totally comptable without having to replace blocks inside, but only saturday night.

LIBERADO

  • *
  • Posts: 2719
If I replace blocks inside, could I have both extensions installed with no conflicts between them?
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

LIBERADO

  • *
  • Posts: 2719
I could put a new version which will be totally comptable without having to replace blocks inside, but only saturday night.
Any news about this?
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

RulezTeam

  • *
  • Posts: 315
Hi yoplalala,

I'm interesting in this extension too. Have you some good news ?

Thanks

SquarePug

  • Posts: 148
It is incredibly time-wasting to manually add half-widths and whatnot just to get spawned actors to line up right. We need a block for this, which might also include other useful options like left and right-align. Stencyl needs some serious workflow improvements.

There is no need at all for Stencyl to do this, we would just end up with an absolutely massive palette.

Just use custom blocks (if you havent learn to use them thats your own fault, nothing to do with stencyls workflow all the info for custom blocks is in the stencylpedia)

I'll attach a screenshot of the main custom blocks I created (best to create them in a behavior, and then upload that behavior to each new game). These work for my needs, but just make as many as you need for yourself.

Once you know how to make custom blocks its very easy to do. Hope that helps.
Website: Satch
Twitter: @satchapps.

yoplalala

  • *
  • Posts: 1633
Dooing this today promise ! Sorry I had a crazy week.

LIBERADO

  • *
  • Posts: 2719
Dooing this today promise ! Sorry I had a crazy week.
:) Ok, we are waiting.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.