Author Topic: BlockOS [On hold until further notice]  (Read 82223 times)

What don't you understand?

What don't you understand?
Is it a separate add on? Does it need to be packaged differently? Does it need to be posted on a website or something?

Have you tried downloading an app and looking at it?

Just a word of warning, I think Brian and Greek2me are working on a new app API for BOS7 - things will be much more simpler.

what in the world what kind of argument is this
floor(x/n)*n is right. floor(x*n)/n isn't. why? the multiplication has to come last in order for x to snap onto grid n x n. otherwise floor isn't adequately used and you're just pulling something similar to a double negative pretty much.

never mind fluff gave a better explaWAIT A SECOND

mRound
it'd probably be more wise to use floor or ceil - otherwise it'll be different results (on a small scale) and the icons could be off by a pixel
« Last Edit: April 30, 2012, 12:40:02 PM by YoshiDude »

what in the world what kind of argument is this
floor(x/n)*n is right. floor(x*n)/n isn't. why? the multiplication has to come last in order for x to snap onto grid n x n. otherwise floor isn't adequately used and you're just pulling something similar to a double negative pretty much.

never mind fluff gave a better explaWAIT A SECOND
it'd probably be more wise to use floor or ceil - otherwise it'll be different results (on a small scale) and the icons could be off by a pixel

No, as I explained - mRound will make it snap to the NEAREST grid space

Have you tried downloading an app and looking at it?

Just a word of warning, I think Brian and Greek2me are working on a new app API for BOS7 - things will be much more simpler.
Thanks. Is there a way to implament an application for Block OS in an add on?

Thanks. Is there a way to implament an application for Block OS in an add on?

Why would you want to?

Not really worth it's own thread:

A HUD addition displaying your ping to the server you are on.
http://localhostr.com/file/AN2kN8x/Script_PingHud.zip



No, as I explained - mRound will make it snap to the NEAREST grid space

it would to the nearest pixel, which causes an inconsistency
i.e.

x=10.6,y=5 -> x=11,y=5
x=10.4,y=6 -> x=10,y=6

they'd both be on different pixels and it wouldn't look very aligned

it would to the nearest pixel, which causes an inconsistency
i.e.

x=10.6,y=5 -> x=11,y=5
x=10.4,y=6 -> x=10,y=6

they'd both be on different pixels and it wouldn't look very aligned

no, no no.

Let's simplify this, say we wanted a 100 x 100 icon grid,
we have a position: 678, 897 - we want this to fit to the grid so first off:
divide both by 100,
6.78, 8.97
Round these:
7, 8
multiply by 100,
700, 800 - Ah they fit the grid.

What have I started? Previously I wasn't trying to say anything about the mRound, just that the multiplication and division cancel out each other.

Lets check the code again:
%xpos = mRound((%xpos * 66) / 66);

The part where it is divided by 66 is still within the call to mRound. They cancel out each other.

if(mRound(%xpos) == mRound((%xpos * 66) / 66)) {
     echo("Holy stuff man, math works!");
}
« Last Edit: April 30, 2012, 04:23:42 PM by Scout31 »

What have I started? Previously I wasn't trying to say anything about the mRound, just that the multiplication and division cancel out each other.

Lets check the code again:
%xpos = mRound((%xpos * 66) / 66);

The part where it is divided by 66 is still within the call to mRound. They cancel out each other.

if(mRound(%xpos) == mRound((%xpos * 66) / 66)) {
     echo("Holy stuff man, math works!");
}


First check what you just tried to copy :p


%x = mRound(%x / 66) * 66;
%y = mRound(%y / 66) * 66;



it would to the nearest pixel, which causes an inconsistency
it snaps to the nearest SIXTY SIX pixels.
mRound(%x/n)*n will make it snap to the closest multiple of n.

Proof that mRound((x*n)/n) = mRound(n):
http://www.wolframalpha.com/input/?i=Round%28%28x*n%29%2Fn%29
« Last Edit: April 30, 2012, 04:52:15 PM by Ipquarx »