Jump to content

Putting text on a lot of buttons

Recommended Posts

I've searched around some, and I'm sure anyone building a UI has had to deal with it, but couldn't find anything that addressed producing a lot of buttons with consistent text placement.  I expect that I'm overlooking the obvious search phrase.


I have an Ergodex DX1 keyboard and I'm wanting to document the layout of the keys for the various games I use it with.  So, I need to generate up to 50 buttons with labels and then move and rotate them into position for each game.  I would like to put the key number really small in one corner, the keyboard key assigned to it, small, in another corner, and then the then the function within the game, larger, and close to the center.


I've built blanks for the buttons, with space for those three pieces of information.  But getting the text lined up time after time is a bit tedious.


What is the easiest process for placing text consistently when dealing with dozens of buttons?


I envision something similar to a macro, that loads the blank and then positions the text tool for the first field, with some way to trigger the jump to the next field.  I suppose a macro for each field would be simple enough.


I'm about to break down and just write a program to do it for me :-p


Does anyone have any suggestions?




Drake Christenen

Link to comment
Share on other sites

One of the fine plugin developers has made one makes shiny buttons that places text and the ability to change it to any font on your system. I do not remember who made it though.


Found it. It's in the Madjik pack.

Edited by Visual
Link to comment
Share on other sites

Unfortunately, there isn't a "snap to grid" option, so you'll have to either:

1. write your own program (like you said)

2. write a paint.net plugin (CodeLab ftw)

3. take the fast route (line things up yourself) and hope you never have to do it again.

No, Paint.NET is not spyware...but, installing it is an IQ test. ~BoltBait

Blend modes are like the filling in your sandwich. It's the filling that can change your experience of the sandwich. ~Ego Eram Reputo

Link to comment
Share on other sites

Thanks for the pointers.  I don't think that the button nor panelling plug-ins will actually save much work.


I think I'll look up CodeLab to start.  If that doesn't fall out quickly, then I bet I can find some example code that I can twist into the shape I want.


Only problem is, I'm already starting to give in to feature creep in my head. :smile:


If anyone else comes up with a suggestion, I'd love to hear it.



Link to comment
Share on other sites

...If anyone else comes up with a suggestion, I'd love to hear it.




My workaround:  Lay it out in MS Excel and do a print screen followed by a paste into new layer.  Use any of a number of plugins (or the magic wand) to remove the white background.

Link to comment
Share on other sites

Excel screenshot?  I'm not sure I follow.  I don't see how that gets the text onto the buttons.  Especially in the different text sizes that I'm hoping for.  I want the key number and key name to be there, but de-emphasized.


I probably should have gone ahead and included a picture of the layout I have on my DX1:


DX1PhotoSmall.jpg  SaintsRowTheThirdSmall.jpg


I used this photo as the background layer, to arrange and align the buttons.  After I have that, I hide this photo layer.  The layout picture here is one I created in Gimp.  (Gawd, that was an awful experience.  The Gimp developers do *not* think like I do.)


Originally, I was going to print out that layout and slide it under the clear plastic under the keys, which is why the labels are beside the keys and not on top of them.  I've decided since then that I don't like that.  I just bring up the picture on my second monitor before I fire up the game.


As you can see, the buttons are not necessarily orthogonal.


Here's what I have at the moment as a new button blank:




Yeah, I know, not all that pretty.  Have you ever heard the term Programmer Art? :smile:


If I'm not going to rotate the buttons and text to match the actual layout of the keys, then I might as well just slap the labels on within PDN.  I don't see how the Excel step helps me.


But maybe I'm missing something?


On the programming front, I glanced at CodeLab.  But, it's a fairly constrained environment.  I think it's going to be easier to just take a Java or C# example and read a CSV file of text labels, to spit out the button files.  I may even build a text file of x,y,rotation values and build the entire layout image programatically.




Link to comment
Share on other sites

I was under the impression you would be transforming a keyboard.  Therefore the regular layout could be duplicated with appropriately sized Excel cells. Your somewhat more challenging layout won't be that easy to replicate except by some hard manual labour.

Link to comment
Share on other sites

Ah, I see, now.  Yeah, what your describing would probably work pretty well for any labeling situation where the labels are lined up with a regular spacing.  Very clever.


Actually, what you're describing could be applied.  If I could replicate the buttons so that they're spaced evenly, then I could label them with your method.  Then, the next time-saving step to search for would be to find a way to split the buttons out into individual files.  Or, some easy way to select the next button for arrangement onto my final layout.


Though, that would still be a lot of manual work to arrange them.



Edited by Mighty
Link to comment
Share on other sites

  • 3 weeks later...

I know that this has become a non-Paint.NET thing, but I thought some people might be interested in the program I wrote to do the layout I was talking about.  Here are a few example output files:


With a blank background (click for full size)


Over top of the photo of the keyboard



On a game-themed background



I came up with what I think is a little less-awful looking button.  But, as I said, I'm not an artist.  I'm sure someone with real skills could take this and make something really creative.


The Readme file, which has a link to download the program, including source.


Drake Christensen

Edited by Mighty
Fixed links
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...