# Detect a close!

#107

He uses the math blocks to compare the current fps to a certain percentage of the starting fps

And bundling up the math blocks like this has the whole math expression run in one frame I think

#108

So, why is this code used?
(Avg.fps-(avg.fps X percent/100))

#109

@Aariv Actually, I tried restarting it from scratch and failed. So he’s, it is confusing, even for me. These coders did a swell job of explaining the main concept, but it can be simplified. As I said, a non-average-using method will be published soon.

#110

Actually, restarting the project has it at full frame rate from the start.

#111

Oh ok hmmm
How did you guys figure it out it is a mystery

#112

Yeah, that is what I based it on. So if the average wouldn’t be less the than the FPS at the start, that means it went full right away, otherwise climbing slowly and suggestion a “first played”

#113

@XAMANION, looking at the formulas in the code screenshots you posted, the “bind” values you want are just 100 / the X & Y offsets. Where the X & Y offset values are the distances from the center of the menu item to the center of the original object (which I assume is the menu) @ size of 100%

If the “full size” of menu is not 100% then the bind values are FS% / Offset @ FS%

Further, depending on the menu layout, the offset values could possibly be a function of a menu item’s clone index. But that would depend on the specific menu layout and clone index numbering of the menu items.

#114

Thank you, I will try that! Also, any good was if sharing a video on here so I can show you exactly how the menu opens closes so far? @ThinBuffalo

#115

You can use the iOS video screen capture and convert it to a gif if it’s short.

I made a quick example to see if this is what you meant (in that the menu texts grow & shrink with the menu). If not, that’s ok. The example might still have values to others. I also incorporated calculation of the individual x & y offsets based on the clone indices and spacing inputs, but the formula is specific to a 2 column menu that stays centered with respect to the menu background…

#116

@ThinBuffalo

What you made is also the exactly what I need thank you! Though:

There is a square set to the corner position (width,0) and grows when the menu is swiped, meaning that only a small corner of the giant square is on screen. So should I recode it your way and then add an offset so it’s not the center of the big square, centers around a quadrant?

#117

That’s very interesting!

That’s what ThinBuffalo used with his code.

#118

Yeah that’s what I will do. I mean it works, except it’s a pain in the but to add more because the only way is guess and check. I will recode it and I hope this works.

#119

@JonnyGamer Actaully, for example when I’m testing my project which involves bring to front blocks, if I play after a long time of editing the frame rate is slow and there are glitches in layering. I have to click restart to get it going properly most times, so that is where I got the idea from.

#120

You shouldn’t have to recode anything. You’re just using the upper left quadrant (-,+) so x offsets will be negative & y offsets will be positive.

Since the menu background object is centered in my example all four quadrants are used. Remember, the offset values are relative to the center point of the menu background object. But the code doesn’t change, just the offset values.

(-,+) | (+,+)
——-——
(-,-) | (+,-)

#121

Time the layering using Repeat N with Wait 0 blocks, instead of Wait T ms. This makes the timing independent of the frame rate so the result will always be the same.

@60 FPS, N = T*(1000/60)

#122

#123

Or you can just scrap the thing completely. It’s ok if you still want to do it this way, but it does looks weird and uncentered in the corner. You could make the same menu concept, but not moving at a diagonal to the center.

#124

Ok. Many Hopscotchers aren’t aware, so I thought I’d mention it.

BTW, I edited my response above. The orientation of the text through me off. I thought your project was in portrait, but now I see from the webplayer icons that it looks like landscape with text rotated 90 deg.

#125

@ThinBuffalo Yeah so I need to just shift the centerpoint if the original object them.

#126

@DECODECO I’m trying to go for a unique feel. Otherwise I would’ve used simple fade in/out.