Hi there from the image below you will see some guides that are set 1mm apart but the pixel lines I have drawn are not aligned nor am I able to get them aligned to the mm. moving the lines with the anchor tool causes them to loses the solidness and bleed into other pixels. does anyone know away to get the pixels to align to the mm?
may just be something Im missing
example image
http://img401.imageshack.us/img401/51/ruleo.jpg
I'd suggest going to your Snap To settings under the View menu and seeing what is turned on or off in there.
You could definitely turn snapping off and manually match the elements up to the lines.
Related
I am struggling with extracting the code from the given inputs on Zeplin design. Zeplin shows me borders with inside of two dimension with each dimension having 4 different color. To be honest, I couldn't understand what does 4 different color means in terms of border. And also, that causes me to cannot create a proper inside border.
Beside, I understand the border axises for X and Y, but I even couldn't figure out how to give only top border and not giving for bottom (like a one side border)
You can find the specifications of the borders at the image below.
I would be glad if you can provide me an example with a code (both for Swift and Obj-C are okay) or I am also okay for any advices through an explanation of the different coloring.
I am making a 2d platformer and I decided to use multiple tilemapnodes as my backgrounds. Even with 1 tile map, I get these vertical or horizontal lines that appear and disappear when I'm moving the player around the screen. See image below:
My tiles are 256x256 and I'm storing them in a tileset sks file. Not exactly sure why I'm getting this or how to get rid of this and it is quite annoying. Wondering if others experience this as well.
Considering to not use the tile maps, but I would prefer to use them if I can.
Thanks for any help with this!!!
I had the same issue and was able to solve it by "extruding" the tiled image a couple pixels. This provides a little cushion of pixels to use when the floating point issue occurs instead of displaying nothing (hence the gap). This video sums it up pretty well.
Unity: extruding tile map images
If you're using TexturePacker to generate your sprite atlas' there is an option to add this automatically without having to do it to your tile images yourself.
Hope that helps!
Sort of like the "extruding" suggested by #cheaze, I simply make the tile size in the drawing code a tiny amount larger than the required tile size. This means the assets themselves do not have to be changed.
Eg. if you assets are sized 256 x 256 and all of your calculations are based on that; draw the textures as 256.02 x 256.02 pixels in size:
[SKSpriteNode spriteNodeWithTexture:texture size:CGSizeMake(256.02, 256.02)];
Only adding .02 pixel per side will overlap your tiles automatically and remove the line glitches, depending on your camera speed and frame rate.
If the problem is really bad, you can even go so far as to add half a pixel (+0.5) or an entire pixel to remove the glitches, yet the user will not be able to see the difference. (Since a one pixel difference on a retina screen is hard to distinguish).
I was wondering what would be the best way to trim the "canvas" of an UIImage (pretty much like any image editor allows out there)
Now, the previous example is not a single UIImage. It's actually 2 UIViews. So clipping the superview against the blue box would do the trick, but I guess I am looking into the best possible way to do this. Given that there could be several blue boxes in the "canvas".
Is there a faster way than going through every pixel?
Thanks!
Thinking about it algorithmically, I would say no. You need to find the pixel that extends furthest to the left, right, top and bottom. Unless you look at every pixel from each direction you could miss non-transparent pixels.
You could speed things up if you figure out how to map your image into memory and then index into memory directly rather than using a high level function that fetches pixels. I would suggest searching from the top down (which would be sequential memory accesses) until you find a non-clear pixel. Then search from the end of the image backwards, which would give you the bottom-most pixel.
You would then want to limit your search from each side to only look starting at the first non-transparent pixel from the top and ending at the last non-transparent pixel on the bottom.
For anything other than a very large image this should take a fraction of a second.
Ok, I was being dumb. The union of the subviews is all I really needed, so its just a simple loop over the subviews and doing a CGRect union against their frames.
I've imported a vector layer from a psd into paint code v1, I'm trying to create a background image and make it universal.
I can't seem to add a frame around the vector, to complicate matters, I only need a portion, the center, of the layer. (The design is based around a circle, it has lines drawn towards the center of the circle.)
I can’t seem to add a frame to dynamically resize the part I need.
I found this http://www.raywenderlich.com/36341/paintcode-tutorial-dynamic-buttons the part about frame ans groups doesn't help me....
When I add a click frame and drag it around the area I need, it's at the same level as the vector layer. I've also tried adding a group around both, but that doesn't seem to obey the frame size either.
I’ve looked through the tutorials and googled adding a frame, but I can’t seem to achieve what I need.
EDIT
A frame is supposed to be at the same level as the vectors you're working with.
All you do then is set the resize rules of your vectors. There is a little rectangle in the frame's parameters interface with straight arrows and springs that you can modify to fit your wishes.
I think I also remember a checkbox setting to resize only what's inside the frame.
Now I haven't used PaintCode for a while, but if this doesn't help you, there probably is a problem with your vector layer.
I don't know if this information helps.
But if you resizing doesn't work as you expected. Look carefully at the transformation box (the one with the springs attached). When you have put a frame around your object. The middle dot in this box should be blue instead of green. if t's green, you may have a problem with the originating point of your objects and then the resizing may not work as you expected.
So here is a question that is sure to stump some people.
Here is my scenario. I want a user to take a picture of something, in this case it will be just a black rectangle with white circles on it. I don't care about the size of the circles, but I want to know how many circles there are and where they are located in respect to the photo. Then a user will enter the width and height of the photo they just took and I will be able to tell the distance the circles are from each other.
Does anyone have any clue how I could do this?
I don't think you will get a straight forward answer.But below is my approach.
Take the image, get its pixel data using CGBitmapContext (reference).
Now search in the array, where white pixels are located (white pixels - colorvalue >240/255).
Now try to find its white-circle-centre using some algorithm (reference).
Store those centers in an array,and later when user gives width ,return widths relatively.