[Open] Set Width/Height block issue?


#21

@hopscotchremixer @tankt2016 it’s a bug or weird and confusing feature with either the set image or set width and height block or both.

It has to do with the fact that both text objects start off as different values.

My solution which worked was change the # to a capitol H then use a set text block in the object’s code.

I’ll go try to figure out what specifically is causing this.


#22

Okay I looked into it and the specific code of setting image to a rectangle and setting width And height to something with a set angle to 90 degrees anywhere in there’s causes this. I’ll go test with other shapes

Edit: it happens with any character


#23

I am not sure if it happens when you do not have a set image block. I think it still does but I’m not completely sure.


#24

It seems like you have found a bug in the Hopscotch app or something similar - go ahead and email THT! That is what I think that you should do.


#25

Why?


#26
  1. I agree this is a bug
    @Ana @awesomeonion Please refer to the problem explained by tankt2016 and Petrichor’s supplementary comments.

@HopscotchRemixer you, especially as a “leader”, should not being trying to talk ppl out of using more advanced coding techniques. You personally don’t have to use or even appreciate the benefits of clones. Everyone’s different and I get that. But leaders should be encouraging the community to learn and advance their coding skills, not holding them back. As a leader other Hopscotchers are likely to look up to and respect your opinion, so when you deride the use of clones that negatively affects the community.

@tankt2016 Your usage was a fine application of clones. I would have coded the boxes & borders in a similar way. Keep up the good work.


@William04GamerA I’ve noticed that your go to comment is to email THT. Why not recommend that THT be notified through the forum as a standard response? That will give other community members the opportunity to participate in the discussion and troubleshooting process (just seeing it will benefit the newest users). And, very importantly, will give the community visibility of THT’s position on the issue and afford THT an easy vehicle to communicate status.


#27

Interesting :thinking: Let me check smth. We’ll get back to you soon.


#28

You are right about that. They usually respond faster to emails, but I have also noticed that THT is on the forum more that you can think. Thank you for the feedback!


#29

Good bug report, thank you.

If you start with two different text objects, then change them to a shape, then set width/height, the sizes will be off.

The issue is that set width/height is actually calculating the width and height as a scaled size percent for each object based on it’s original size.

Since H and # have different sizes, the rectangles will have different sizes. A good way to see this more clearly is to use text objects that are more different. i.e.
H and AAAAAA

We will look into a fix, probably next week.


#30

Yes… idk if this is what you mean, but if you have a text and shape object, this will happen

Run the code:
set text hi
set width 100 height 100

They’ll be different because the set width height refers to the shape even though it is a text


#31

@awesomeonion
Perhaps now would be a good time to fix this (the “full” image width/height verses the visible image width/height) as well:

I assume each image would need a unique property/value for X and Y ‘apparent scale’?

So the final image scale is determined by:
Width/(Original_Width * Apparent_Width)
Height/(Original_Height * Apparent_Height)

where Height & Width are the object traits & are set by the Set Width/Height block.

Just throwing mud on the wall to see if any sticks…


#32

Problem is, I’ve gotten used to guessing and checking what works and already have a few set width heights in E-Pad


#33

Yes, I have projects as well where I’ve manually implemented the ‘apparent scale’ concept (like the Rubik’s Cube). Problem is, I believe the percentage of Hopscotchers who are able to figure out and utilize this concept is really low so very few Hopscotchers are able to use the Width/Height traits for (one of) they’re intended purpose(s) of low lag collision code.

The player would “just” need to be version dependent to avoid breaking existing projects.


#34

Yeah, it’d be hard and it’d be an odd thing to update, and we already have many projects with this block. I think people will be able to guess and check their way and keep the ratios. I mean, I know you probably know the ratios between text and triangle and square so you can always calculate it, but so far, guessing and checking and saving ratios seems to work just fine


#35

Fixing this might totally break my project’s width/height lol
I’d have to redo the width/heights (which I wouldn’t really mind but still)


#36

Yeah I don’t want that risk either with E-Pad (current Project)