Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have the following code inside Svelte REPL:
https://svelte.dev/repl/b96c96bb3a654f5a81813525d22a8820?version=3.29.0
There's a problem: the chessboard doesn't appear, or at a better case (without onMount) flashes while appearing, and then disappears...
What's wrong in this code and how to fix that ?
I think the problem for you is coming from how you're attempting to push cells to defs. When you replace defs.push(cells) on line 36 with defs = [...defs, cells] it allows the columns and rows to be created properly. Then for some reason you're setting xmlns through a variable... this is the main thing preventing anything from showing up. There is no reason to use a variable to set xmlns, pretty sure it's preventing the SVG from being created properly when done this way and you don't actually need xmlns for inline SVGs, so you can trash that and all works well as shown here.
However, unless you're planning on using the empty space inside the 1000 x 1000 SVG area then I'd advise you to cut it down to 800 x 800 so the squares fit into the overall dimensions better.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
The community is reviewing whether to reopen this question as of last year.
Improve this question
I am making a 2d platformer.(using gdscript)
I have been trying to make a guide arrow that shows you where to go and have been failing. I far as I can see there is no godot tutorial for this yet.
I have however managed to find a unity tutorial but have been having a hard time converting the instructions to godot.
https://youtu.be/dHzeHh-3bp4
Thanks in advance :)
I'll assume the indicator is a Sprite with whatever icon you want to show.
By the way, you are going to need a reference to the Camera2D. Unlike in 3D where you can ask Godot for the current Camera, you will have to handle references to the current Camera2D yourself.
I'll assume you already have the reference to the Camera2D (perhaps you have the code in the Camera2D script) and the reference to the indicator Sprite (which is another possible place to have the code).
I'll also assume you don't have a rotated Camera2D.
First we need the center of the screen:
var center := camera.get_camera_screen_center()
Then we can get the vector to the position we want:
var vec := target - center
Where target is the position in global coordinates you want to point to. By the way, if vec is Vector2.ZERO, then the target at the center of the screen.
Let us clamp it by the size of the Viewport. We are going to use half the size since we are measuring from the center of the screen. I'll also add a margin, I'll come back to that, for now, assume margin = Vector2.ZERO.
var helf_size := (get_viewport().size - margin) * 0.5
var clamped_vec := Vector2 (
clamp(vec.x, -half_size.x, half_size.x),
clamp(vec.y, -half_size.y, half_size.x)
)
If those are equal, it means the target is on the screen (it didn't need to be clamped):
if clamped_vec == vec:
# target on screen
pass
else:
# target out of screen
pass
Now, to place the indicator we need two things: a rotation and a position, correct?
The rotation is easy. It is the angle of our vec:
sprite.global_rotation = vec.angle()
And for the position, well, it will be our clamped_vec except we need to place the indicator. So we need to add a... Margin! Aha! So, adjust the margin to the size of the indicator you have, and clampled_vec will give us the position, we just need to add center back:
sprite.global_position = clamped_vec + center
And that should do it.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I want to make the image sticky in the layout right end corner in axml.
EDIT
I Realize now OP needs Xamarin Android. This was written for Xamarin Forms. :)
Check this question as this is a possible duplicate:
Set the absolute position of a view
--
Try an absolute layout.
<AbsoluteLayout>
<!--If You have other content, like a stacklayout, put it before the image (like below)-->
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1">
<!--Content Here -->
</StackLayout
<Image Source="YOUR IMAGE SOURCE" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="1,1,0.2,0.2" />
</AbsoluteLayout>
Let me explain how absolute layout kinda works.
So an absolute layout allows you to place things on top of each other (Or just set a static position).
Absolute Layout Bounds work as follows:
(position X start, position Y start, Width, Height).
So by typing (0,0,1,1), I'm telling it to start at 0,0, and the width and height should be the same size as the window. If I were to do (0.5, 0.5, 0.2, 0.2), then I'd be telling it to start half way down and half way from the left, and make the object 0.2 of the total window size.
Ref Documentation:
https://developer.xamarin.com/guides/xamarin-forms/user-interface/layouts/absolute-layout/
Hope this helps
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I have this chart and I want the line at 0 to be WHITE instead of BLACK, but I'm not sure which property I have to change.
I've already tried:
((CategoryPlot) chart.getPlot()).getDomainAxis().setAxisLinePaint(Color.WHITE);
((CategoryPlot) chart.getPlot()).setDomainGridlinePaint(Color.WHITE);
((CategoryPlot) chart.getPlot()).setRangeGridlinePaint(Color.WHITE);
And none of them seem to be what I need. I also tried searching for a solution, but I'm not sure what this line is called exactly, so I don't really know what to search for. Can someone please tell me which property I need to set to WHITE?
The line drawn perpendicular to the range axis (y-axis) at the value zero is referred to in JFreeChart as the rangeZeroBaseline. The method you need is:
http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/CategoryPlot.html#setRangeZeroBaselinePaint-java.awt.Paint-
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Is there a command line tool on linux that would extract figures from a pdf file, and save them in vector format? I know about pdfimages, but that would create a bitmap, and that is not what I need.
not for images only, as you seem to need, but
pdftocairo
http://poppler.freedesktop.org/
http://www.manpagez.com/man/1/pdftocairo/ (manpage)
is able to render a pdf page to other vector formats like PS/EPS/SVG
assuming you have a pdf page with vectorized images, you can render this page to svg and then copy only image you are interested in
note: pdftocairo cannot render multipage pdf to multipage svg
if you need to convert to svg several pdf pages you need first to pick this page range and then burst pdf pages into single pdf pages
example (if we need to convert pages 1-10 of a pdf file to svg)
1°
pdftk file.pdf cat 1-10 output 1-10.pdf
2°
pdftk 1-10.pdf burst
3°
for f in *.pdf; do pdftocairo -svg $f; done
4°
finally, with sodipodi or inkscape, you can extract images you are interested from svg rendered pdf page
What do you consider a "figure"? This is a concept that doesn't exist in PDF. The reason there are so many tools that can extract images from a PDF file, is because images are a very clearly identified entity.
Your "figures" however, are much less clearly defined. PDF files may contain lots of vector content that you wouldn't call a figure. Text can be stroked for example, which would make it vector art and as such it might be confused with your figures. Other decorative elements may be used in the background of the pages. Text may be underlined, which would be a vector element...
In the other direction, your "figure" may contain a caption that is text, further complicating things.
As PDF doesn't have the notion of a figure, you'll have to figure out how to isolate one on a PDF page (perhaps because the creator application always adds metadata to them, or because they use a special color or... If you can isolate them, it should be possible to trim everything irrelevant on the page and export what you need as EPS or SVG using some of the techniques described in the other answer.
This article describes the tools gpdfx, inkscape and pdf2svg which are not completely commandline-based, but still sound helpful.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have been using Photoshop for about three weeks now, finding it very different to fireworks...
Im trying to make a cool effect on my site, I want to use JQuery to slide a background image behind some text, and the background show through the text. I need to text to be placed in a white box, with the text itself "punched" out, so you can literally see through it (but only the text, the white box will cover everything else). The text also needs an inner shadow effect...just no fill. I am having real problems finding this info, can anyone help?
Many thanks, Dan
Create your white background layer
Create your text layer with the font and size you want
Ctrl+Click the text icon in the Layers panel to select the outline of your text
Select your white background layer and press delete to cut the text shape from your background
Select your text layer and delete it
Apply your drop shadow or glow filters to your background layer
Save as a transparent PNG-24
Your question doesn't sound too clear but i think animating the opacity of either of text or background would help.check this