Jump to content

How to center this?

Go to solution Solved by minibois,

x and y?

As for x:

TextField.x =(WholeFieldWidth / 2) - (TextFieldWidth / 2)

y is the same, but with .y and height obviously.

 

(Not sure what language though and what kind of variables it has)

x and y?

As for x:

TextField.x =(WholeFieldWidth / 2) - (TextFieldWidth / 2)

y is the same, but with .y and height obviously.

 

(Not sure what language though and what kind of variables it has)

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
https://linustechtips.com/topic/378676-how-to-center-this/#findComment-5117215
Share on other sites

Link to post
Share on other sites

x and y?

As for x:

TextField.x =(WholeFieldWidth / 2) - (TextFieldWidth / 2)

y is the same, but with .y and height obviously.

 

(Not sure what language though and what kind of variables it has)

 

No but I don't mean in a programation language. I mean in general, how woud you sort it out?

Link to comment
https://linustechtips.com/topic/378676-how-to-center-this/#findComment-5117228
Share on other sites

Link to post
Share on other sites

How do you expect people to help you if you aren't more specific as you are right now?

 

Well he helped me out and I was not specefic. And I kinda did, I said in pixels. Not in programmation, just in general, doing it with your head. I know it's sutpid but I couldn't figure it out.

Link to comment
https://linustechtips.com/topic/378676-how-to-center-this/#findComment-5117246
Share on other sites

Link to post
Share on other sites

No but I don't mean in a programation language. I mean in general, how woud you sort it out?

Well, kind of like I did still.

Take the half of the width of where you want to place it, take half of the width of the thing you want to place somewhere and subtract that last number, with the first one and you will know where to position the middle of the object on the platform.

 

Are is this still too much like programming? '-'

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
https://linustechtips.com/topic/378676-how-to-center-this/#findComment-5117249
Share on other sites

Link to post
Share on other sites

Well, kind of like I did still.

Take the half of the width of where you want to place it, take half of the width of the thing you want to place somewhere and subtract that last number, with the first one and you will know where to position the middle of the object on the platform.

 

Are is this still too much like programming? '-'

 

It's fine, I was just precising that it wasn't for a language because you said "(Not sure what language though and what kind of variables it has)". I already picked your answer.

Link to comment
https://linustechtips.com/topic/378676-how-to-center-this/#findComment-5117346
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×