How can I display text as 3D on a Canvas in Flutter? One way I've thought of is to replicate the text multiple times but display each replicant as an offset from the original text. The problem with that is that you won't be able to distinguish the edges because there wouldn't be any shadows/lighting.
Related
Hi I am trying to create custom buttons on unity (trapeziums). I successfully created the visible area on Photoshop and imported it as Sprite 2D UI as per the following image:
The issue arises, when I'm trying to select one of the buttons in game, their border overlap each other, since the transparent area is still being considered as part of the clickable button area. How can I remove this?
EDIT:
Practically when I import I want the squared boxes to not be counted with the image. I need the edges of the orange area to be cut flush with that and not the entire area(i.e. including the transparent boxes).
You may achieve this by using Alpha Hit Test Minimum Threshold. Take a look at this nice video tutorial.
There is one extra step that is not shown in the video but mentioned in the comments: you have to change "Mesh Type" to "Full Rect" and not "Tight" as it is.
Hope that helps.
The clickable area is based on the Rect Transform component of the GameObject. Adjust the width and height to the clickable area you want. You may have to crop your image in photoshop accordingly. If you select 'Gizmos' in the editor you can toggle viewing the click region.
Unity Version: 5.6.5f1 Personal
TextMesh Pro Version: 1.0.56.0b3
I have a TextMesh Pro UI Text object whose area intersects the area of a UI Image. The text is dynamic, but the image will never change. Is there a way to make the TextMesh Pro UI Text flow around the image similar to how text would wrap to one side in HTML/CSS?
The image below shows two copies of the object in Unity. One object, denoted by a red space where the image is located, is what I'm currently getting. The text enters the space of the image. The other object, denoted by a blue space where the image is located, shows the desired outcome where text is wrapping properly.
Current vs. Desired Outcome:
Research so far:
How do I put an image inside text? - The Image that I'm using is a UI Image, not a text asset. The Image will only act as though it is inline with the text.
How do you wrap text around a rectangle?, Fluid layout for Unity UI - These are what I'm looking for. However, no suggestions have been posted in them.
I've explored the idea of using multiple TextMesh Pro UI Text Objects, with each one acting as a fragment of the complete text area. However, this isn't the same as wrapping the text around the Image. For dynamic text, if I pull content from one text area and push it into the next area, this will conflict with the Auto-Sizing functionality and cause unequal font sizes.
Another possibility is that I could insert characters one at a time, check to see if adding another character would result in a collision with the image, and add System.Environment.Newline to prevent this. However, I worry about the potential performance issues from dealing with large amounts of text.
TextMesh Pro Documentation - The TextMesh Pro Documentation has some tools for finding word wrap points, but I haven't figured out how to implement a means of comparing this to an anchor position of another object.
This can be accomplished with TextMeshPro's "Linked" overflow mode. See attached picture for an example. Essentially, you'll need to make two TMP objects and adjust the layout for each of them appropriately. Then:
1) change the overflow mode of the first one to "Linked" using the dropdown in the inspector.
2) place the second TMP object as the reference in the field that appears.
I am trying to make a template for my company's profile. I want to make rectangle curved from one side. As shown in the figure below. The blue box is a rectangle and the curved line is a curve in word. How can I ignore/delete the highlighted area in MSWord?
You can try using an image instead of the built in shapes. Insert the image, set the height to the full height of the page and set the text-wrapping so it is behind the text. Here's a sample image to try.
Instead of a curved line, use a filled oval shape in front of the rectangle. You might need to use the numeric fields in the Format tab to get the size you need. Also, if you put these elements in the header, they won't get in your way when editing your docs.
Help, I need to create a PDF with iTextSharp that has
1) A green background for the entire document
2) Text (headings, tables, paragraphs) appear on a white background.
3) Special sections appear with a pink (or other color)
4) Headings on a Blue Background with White Text.
I can build a simple document, but the background colors are really throwing me off.
I add content using paragraphs, but I'm not sure how to set the background color of the paragraph, or group them together.
You create the document using objects such as Paragraphs, PdfPTables, and so on. You draw the rectangles using PdfContentByte methods. You obtain a PdfContentByte instance from a PdfWriter like this:
writer.getDirectContentUnder(); // Java
or
writer.DirectContentUnder; // C#
By using getDirectContentUnder() instead of getDirectContent(), the rectangles are drawn under the Paragraphs, PdfPTables, and so on.
Your main problem is keeping track of the coordinates: you need to know the coordinate of the lower-left corner and of the upper-right corner.
Drawing the background for a full page is a no-brainer. I've answered this question yesterday: How to draw border for whole pdf pages using iText library 5.5.2
Granted, in that answer I defined a border color for the rectangle because the OP only needed a red border on each page. You need to define the fill color of the rectangle instead of the border.
By examining the answer to yesterday's question, you'll discover the concept of page events. You'll also discover other page event methods, such as onParagraph() and onParagraphEnd(). These methods receive the Y coordinate of the start of each paragraph and the end of each paragraph. You can use these coordinates to draw rectangles in the page event.
To solve your problem, you would add a BaseColor member variable, a variable that keeps track of the initial Y value, and so on. It will require some programming, but with all the mechanisms explained in my answer, you should be able to meet your requirement.
Here's how I got it done:
Set the background color in the document
Created 1 column full page width table and set the white background
for each cell.
Add all my content to a cell
Add a new cell for each section
Draw a green border between cells, the same color as the background.
Placing content in the cells solves the problem of keeping track of the coordinates. Since the content could contain multiple paragraphs, sub-tables etc. I'm not sure if the onParagraphEnd would always fire.
Putting the content in the cells also allows control over color.
I have created a ticker for my project which is working fine.
I want to add up a down arrow image within this ticker as per the stock market.
What should i have to do?
Can anyone help me?
Probably you have to create the desired image pixel for pixel and stick it just after the stock ticker text.
If you are familiar with QT, there is side scroller code with even alpha-blending. It is based on scrolling a text pixel by pixel. Then it would be rather non-complex to add icons.
Though the stock ticker text and the corresponding icons need to be contained as a block of pixels, so you have to repaint all those pixel-blocks next to each other on every paintevent or timer-tick.
Here is the source code for the side scroller: Qt - Scrolling the Text in QWidget