What does Axes and Keys in NGUI do? - user-interface

In NGUI of Unity 3D,
there is a script called UI Camera (Script).
At the Bottom of the Inspector, there are parameters for Axes and Keys.
How do you use them, and what are they good for?

From the NGUI documentation for UICamera:
Axes and Keys section lets you choose which axes result in which movement.
http://www.tasharen.com/forum/index.php?topic=6711.0
The axes and keys are controller inputs. You can find the settings for the parameters you see (vertical, horizontal, etc) under Edit> Project Settings> Input.
An example could be using the arrow keys to scroll through buttons and hit the return key to select instead of using your mouse and mouse click. To try that out, take a look at the example scene: "Example 4 - Controller Input".
Attach the UIKeyNavigation component to the play, options, and exit button.
In inspector for UIKeyNavigation on the "play" button, check "starts selected".
In the inspector for UICamera, uncheck mouse and touch so we can see the keyboard input.
Now hit play and press the up or down arrow keys which will now scroll through the buttons.

Related

NSButton "text only" variation that highlight on click?

I'm trying to find a Cocoa control/button that is "text only" and tracks its highlight when click on. I've tried several combinations of push button with the Bordered checkbox unchecked, and Type set to as momentary push in, momentary light, and momentary change -- but I get no animation or difference in the running program (when the button is clicked).
Have you tried something like this?
It gives a button without borders, which highlights text on click, and unhighlights on the next click:
Is it something like you're looking for?

XCode: Graphical button with invisible title

I have a bunch of buttons. They appears as an graphical image. If a user clicked on a button I can determine with
sender.titleLabel!.text!
which button the user pressed. But the title of the button appears in the view. I want only to show the image and give the button a invisible title. But I think that is not possible.
Me second solution is to create for each button an outlet. But I think with 30 buttons that is a very bad solution.
Option 1:
For the button text color property set opacity to 0. The text is there, but fully transparent.
Option 2:
You may use the tag value to identify a button so you do not have to rely on the button title. You can set the tag value in interface builder (Xcode) or in code. (The tag is an integer.)
I usually prefer option 2 as it is resilient to text changes over time (think of typos, translations for other languages etc.).

Sublime Column Selection with Left Button?

According to this spec, I have to use right mouse button to drag a rectangle for making column selection. This is very inconvenient because I am using a mouse pad and it's hard to do a right click.
Is there a way to fix this binding so that left mouse button can be used instead of right mouse button?

Drag the canvas in interface builder

Is there any way to drag the canvas in interface builder, like the hand tool in Adobe Reader?
There is no hand tool like in Adobe Reader. You can use two-finger scrolling if you have a trackpad. You can use your mouse wheel to scroll vertically if you have a mouse wheel. Otherwise, you just have to use the scroll bars.
I think two-finger scrolling on a trackpad is the best of the suggestions here. If you're not using a trackpad, 'Zoom to Fit' may work for you. In addition to zooming, it also centres the storyboard in the window, which, nine times out of ten, is what I really want to do when I'm wishing I had a hand tool.
There's no default shortcut for it, so short of defining your own, just right- or control-click on the canvas and select 'Zoom to Fit' from the contextual menu. Alternatively, click a scene or view in the document outline to centre on that view. If the view can't fit within the visible workspace, it will automatically be scaled down to fit.
You can scroll using keyboard:
⌘ → Scroll right
⌘ ← Scroll left
⌘ ↓ Scroll down
⌘ ↑ Scroll up
it is very painful, but what can I say, Nice Job Apple! :(
I use keyboard shortcuts to zoom the canvas to 50% or 25% first, then use the cmd-arrow keys. That way, every arrow key has a larger effect.
Zooming to 25% makes the canvas items really small, so you can cover a lot of ground with a few cmd-arrow keystrokes.
Not the same as the hand tool - and certainly not as easy as using a Magic Trackpad - but you can scroll horizontally by holding down the shift key when you use the mouse wheel.
Mousewheel: ↑ ↓
Shift+Mousewheel: ← →

How do I resize a window (animating)? Hiding and unhiding menus

Yeah, I did my homework and I found the setFrame:frame display:YES animate:YES but I don't understand how am I find out the height necessary to make it bigger or smaller. Let me exemplify: I'm making kind of spotlight search tool but when the user start the app it will just have a textfield (to type in the search keywords) and a button (Filter Settings) and the window fits the size of these two objects (NOTE: The window start position is on the center and on the top of the screen). When the user hits the "Filter Settings" button I want the window to make an animation going down and then showing the "check box group" that filters the search results.
In your case you need to find out the height of the check box group that you are adding to the view. An easy way to do this is to make a seperate view in your nib that contains the check boxes. Hook up the view to the window using IB, and when it is time to display the check boxes add that view to the windows content view and animate the window resize.

Resources