An easy way of setting a ZPL template as landscape rather than portrait? - zpl

Is there a simple way of setting an entire label to print in landscape orientation rather than portrait? I tried the FWR method but it doesn't seem to affect it at all.
I get the feeling i'm going to have to completely realign my fields and graphic boxes if i want to make it landscape.

^FWr command changes orientation of a field.
If you want to set whole label orientation, use ^POa instead, like described e.g. in Label Rotation and Orientation for ZPL based Desktop and Tabletop Printers document.

The ^PO command will only allow you to rotate in 180 degree increments, so that will not help you here.
Unfortunately, the answer to your question is "No." In order to switch between landscape and portrait modes, you will need to manually rotate/reposition/realign all your graphic boxes, text fields, and barcodes. (I feel your pain though, I've had to do this before and it is not fun.)

Related

How to make CGWindowListCreateImage render correct background color?

Capturing an image of an off-screen window with CGWindowListCreateImage is a common way to create QuickLook style zoom-in animations, but this seems create an image with the wrong background colour, slightly lighter than the real window.
This causes a flash at the end of the animation which kind of ruins the effect.
Does anyone have any idea why this happens and what can be done about it?
EDIT: I created a demonstration app for this problem. It is a bit large and complex for a Stack Overflow question, but the relevant code is probably in the ZoomingWindow.m methods takeSnapshot and makeAndPrepareSnapshotWindow.
Setting the window appearance to textured in Interface Builder fixed this. Of course that also changes the color of the window, but that is acceptable in this particular case.

Create pop menu Sims's style when click on Character in Unity3D

I'm trying to build a game that uses a concept from the known game "The Sims". Right now I'm building the AI for a 3d Character, and I need the player to be able to tell where the character should go or do. I want to know the best ways to create a pop up menu with animations, kind of to show some choices, so that when the player clicks over the 3d Character he can pick wherever he wants to do. I know this must be using UI elements under a Canvas that's placed over the player. However I can not have 2 Canvas in a Scene and I don't know how to fix them to the character so that it moves with him. Thanks in advance.
Here you can see what I mean, this is the Sims Game
You have two main approaches here:
1) Use a world space UI.
2) Use a screen space UI and position it in real time using a worldspace to screen space transformation.
Both of these topics will expand substantially when you approach them, so it's not possible to give any more specifics from here.
Having played the Sims a bit before though, I would suggest you use a world space UI system if you're chasing the same style as them.
You can have as many canvases as you want. To control levels of canvases (which one is on top) you use "Order in Layer" parameter in "Canvas" component of your chosen Canvas. The lower the number is the higher interactivity and visibility your canvas has.
You can create one canvas ant parent it to you character. AS the canvas will be smaller your should play with these parameters to get the resolution you want (don't over do it):
To make canvas always facing the camera you should give Canvas a new script, with a command:
canvas.transform.LookAt(camera.transform);
To control canvas' visibility you may use this code line:
canvas.enabled = bool;
Where bool is false when you want to hide it and bool is true when you want to show it.
In the "Sims" the visibility comes with animation which you may do also, but I would leave it after I did all the functionality.

Autolayout just not working for every screen size

My app is a game and the menus have many labels and buttons and I cannot get all of the different screen sizes(iPhone 4/5/6/6+) to look acceptable from the same set of constraints.
Is there a way that you use to synchronize all the views together to look the same on all different screen sizes?
The project is locked to only portrait so I don't need to consider rotation.
For Autolayout, you
Consider the screen sizes you want to support.
Which view/buttons/labels/imageview etc you want to remain fixed while in
different screen size.
Which view/buttons/labels/imageview etc can be scaled to fit the screen.
Now if by scaling the things you can fit on the screen then you are good to go. But if you still can't find way then you would probably need to you use scrollview and and add a UIView (let's call it content view) to it put your all stuff in it and constraint them vertically all the way from top to bottom.This video can help you if you want to use scrollview
https://www.youtube.com/watch?v=UnQsFlMGDsI

Java Fx : strange behaviour when trying to write a Label vertically

I have noticed a strange behaviour concerning rotated texts (Label,...) in JavaFx...
Originally, I just wanted to be able to display Labels vertically in a GridPane. The first problem is that there is no simple way to tell a Label to display its content in a given direction/orientation. It would be nice to have something like the Side property of the tabPane which would allow to easily turn the text around...
Anyway, I then resigned myself to use the Rotate function to turn my Label. That is when the strange thing began to occur...I am putting my Label in a grid cell which would not be large enough to display the full text if it is not rotated but the text should be able to fit once rotated. The problem is that the text appears wrapped even when it is rotated as if the wrapping test were done before the text is actually rotated... The problem can be seen on this screenshot http://hpics.li/e210f2f : the text that should be displayed is written in the Tooltip and we can see that only the first letter of the rotated text is displayed in the cell grid even though there is more than enough space to display it all...
Anyone has any idea on how to solve that ? Is it the intended behaviour or is it just a little bug ?
Thanks in advance for your answers.

Xcode GLKit printing Text on GLKView without using UIImages

I have an app, its a small game using opengles with GLKit.
No im wondering how it works when i want to draw text on
my screen (if it is possible).
How can i do it?
i draw all of my game objects using images (wrapped in some kind
of sprite). its possible to scale, to move, and to rotate.
everything works fine.
but finding out how it works to print text on that glkview
gets me deep inside of problems ^^
I dont want to use uiimages cause i also dont know how
to present uiimages on a glkview.
There are a number of ways to do what you want:
1) Have an image with all the text glyphs you need in it. For example, if your application is in English, you'd have the 26 uppercase and 26 lowercase letters in the image. Upload that texture to the GPU and use the proper texture coordinates or glSubTexImage2d() to pull out the glyphs you need. (It's not clear to me if this is what you meant by not wanting a UIImage. It doesn't have to be a UIImage, though that's probably easiest.)
2) Every time you need to display text, draw it on the CPU on the fly, and upload the entire word, phrase, or sentence as a texture. You could create a CGBitmapContext and use Core Graphics to draw text to it. Then upload it using glTexImage2D().
3) Get the individual glyphs out of the fonts and draw directly using the bezier curves that make up the glyphs. This allows for 3D extrusion, too. However, this option is the most time consuming to code and probably least performant. It also involves dealing with the many small problems that fonts have (like degenerate segments, and incorrect winding orders). IF you want to go down this path, I think maybe Core Text can help.
There are at least two clean ways to do this, depending on your requirements.
While documentation advises against compositing over a CAEAGLLayer (GLKView), it works quite well, at least in recent iOS versions, when transparent content is layered on top of the CAEAGLLayer. For example, try dropping a UITextView, with opaque set to false and a clear background color, on top of a GLKView in your Storyboard in Interface Builder in the Apple GLKit template or your app. In my test on an iPhone 5, frame rendering time remained around 1ms, even while scrolling in the text view. If your text needs are static, or you don't want the user to interact with the text, use CATextLayer as a child layer of your EAGLLayer instead of a view.
The second approach is to render the text into a texture. You can then composite the text onto your view by disabling the depth buffer and rendering the texture on a full screen rectangle. Look at UIGraphicsBeginImageContextWithOptions to see how to render to an offscreen image with Quartz. UIGraphicsGetImageFromCurrentImageContext allows you to retrieve the UIImage to use as a texture.

Resources