Put borders to a text mesh - components

I want to make a simple text box prefab. How can I keep the text in the textbox? Very simple question :)

Couldn't be easier
(1) Add a canvas
HINT always select "Scale with screen size" (Unity accidentally setthe wrong default there; you only ever use "Scale with screen size")
(3) Add UI -> Text
Set horizontal to WRAP
Look at the large yellow arrow
Leave the vertical as overflow (just choose a small height, say 10, for the box: it is irrelevant).
Set the width of the box to whatever you want - other large yellow arrow.
(In your specific example, it looks like you have a gray box, with a Text sitting on top of that gray box. You should simply make the text box expand to fit the gray box.)
Unity's reactive layout system is fantastic. If you're just getting started with it, search on here for QA and don't hesitate to post more questions. It is hard to master, but worth it.

Related

Changing text canvas size

I realize I may not have my terminology down yet, I'm new to after effects, so I've attached a picture of what I am trying to achieve. I'd like to know how to resize the black canvas surrounding the "of magic" text layer can add more text.
Go to Composition > Composition Settings and change the size (in pixels) of that canvas under width and height.
Alternatively if this is a text block within an already larger canvas, click onto your text in the composition with the Type Tool cmd+t/ctrl+t and expand using the corner points to expand the visible type.

HTML/CSS/JS translation - is this grid in my project? If not - do I need one to code this project?

I need to translate PSD file into HTML/CSS/JS...
Here is this project:
https://s15.postimg.org/s421pj5mj/PSD.jpg
https://s24.postimg.org/8xq87z3v9/PSD_2.jpg
QUESTION What are those 1.vertical and 2.horizontal sky-blue lines and how are they supposed to help me as for somebody who translates this PSD into HTML/CSS/JS ? Don't they seem a bit chaotic?
Despite being blue in your example, these are called "Redlines". The lines are meant to help you see the alignment, sizing, and spacing of elements.
For example, there is one center line down the very middle. You can use that to see that the "Creative Digital Solutons" text is centered, as is the the "Personal Services" text, "Responsive web" section, and "Latest project" section.
You can also see that at the very bottom of the second image, certain pieces of text in each column should line up with certain pieces in other columns.
Usually you will find a particular element or group of elements like this:
With the red lines I added you can see that the icons should all be the same width, and the left side of the icons should align with the left side of "Latest Posts".
Sometimes these redlines contain specific measurements (font: 14pt, margin: 10px, etc.), but this one doesn't, so you just have to use the lines to help you visualize
Yes it is chaotic, but that's how it goes sometimes

Anyone know if its possible draw to erase the picture on the top?

Scratch allows selection of the color using the set pen color. Does anyone know if its possible to program to set the color to transparent so that what ever is drawn can effectively be erased? What would the color number be for that?
Update
The idea was to cover a picture (background) with a colour drawn over the top. Now give the player a little creature that erases the colour on top, they have a certain amount of moves or time to guess what the picture is. The less moves/time they use the more points the player will be awarded.
But the problem seems to be that in the paint a sprite part of scratch erase is an option, but not in the pen programming.
If I cant solve it using erase apprach, my alternative is to make a lot of sprites covering the picture and hide them when the creature touches them. But it seems less fun for the player as the uncovered patterns will be more predictable.
Unfortunately, this isn't really possible. If you have a backdrop that's all one color, you could set the pen color to be the same as the backdrop and color over what you already have (giving the illusion of erasing), but other than that there really isn't a good way.
Your only other option is to use the clear block and then re-draw everything except the piece you want to erase.
If you want to give more context about your specific project, I might be able to help you work out a solution (I've done quite a lot with pen blocks over the years).
Like PullJosh said, it isn't really possible but you can make a sprite called Cover and make it a circle of any color you want. Then, it can clone it's sprite over the sprite you want to hide. Then you can attach a script to the clones:
https://i.stack.imgur.com/S6h4c.png (ctrl + click)

Fabric.js - text decoration looks not exactly right

This image is from kitchensink, and the problems are :
Line through doesn't exactly at right place (see the left text at top)
When it's italic with background color, the text is a bit out of its background (see the left text at top)
Underline is a bit far from text, or can we adjust its distance?
Thanks.
You're seeing an experimental feature — fabric.IText — that's currently in development. It allows to edit text inline and supports partial formatting.
The problem with line-through is known.
Underline being far probably has to do with stretched text. When I load kitchensink it looks good.
Background and italics is an interesting one. I just checked google docs and there's the same problem there:

How to prevent OnCustomDraw of CTreeCtrl from painting Default painting on my painting

I created a CTreeCtrl but I need to mark some of the items in red colored hollow box.
So I created the function OnCustomDraw and drew a red colour box around the item. The red box is appearing but the text part and image parts are drawn on top of the red box so some part of the box cannot be seen. I guess the default painting is overriding my painting. Can anyone tell me how my painting will be over the default painting.
I assume you should be painting on the correct stage. CDDS_ITEMPOSTPAINT seems to be a good choice. Here you would find more information on that.
You should insert an item (your draw possibly as a bitmap and your text as well) instead of updating just your draw.

Resources