scaling

In SpriteKit on iOS, scaling a textured sprite produces an incorrect frame?

▼魔方 西西 提交于 2020-01-01 05:35:07
问题 I'm learning SpriteKit game development for the fun of it & I've run across a seemingly simple problem that has me stumped. Basically, after I scale a textured SKSpriteNode, the frame is NOT what I expect. I have figured out a few hacks to force it to what I want, but I'm trying to understand what is going on. Any ideas appreciated! Here's my code WITHOUT SCALING: func addSpaceship() { let spaceship = SKSpriteNode.init(imageNamed: "rocketship.png") spaceship.name = "spaceship" // spaceship

HTML5 canvas scaling issue on iOS platforms

半城伤御伤魂 提交于 2020-01-01 03:39:05
问题 I've been developing a project in phonegap, attempting to build for Android and iOS. The main idea is to access a saved picture on the phone library, save that picture to an HTML img element, and then draw that img element onto a canvas. From there, the user can scale and rotate the image. I've had no issues on the Android. I've tested using emulators and devices, and have tested a wide array of devices (different pixel ratios, densities, etc.) and the resulting canvas transformations always

Translating/transforming? list of points from its center with an offset/distance

只愿长相守 提交于 2019-12-31 05:28:06
问题 Well, I'm currently trying to move a list of points using its center as reference with a desired offset. But I'm having problems. I have implemented the current function: public static IEnumerable<Point> Translate(this IEnumerable<Vector2> points, float offset, Vector2 pivot) { foreach (Vector2 v in points) { float magnitude = (v - pivot).magnitude; Vector2 n = (v - pivot).normalized; Vector2 _v = n * (magnitude + offset) + pivot; yield return new Point(_v); } } Note: Point class is an own

How to scale and add correct a logo in ffmpeg command?

家住魔仙堡 提交于 2019-12-31 04:33:33
问题 I am trying to apply a watermark and also to scale it to the current video size via ffmpeg command: Here is my inital comand that works without watermark ffmpeg -v 0 -vcodec h264_qsv -i 'udp://@some.ip:1234?fifo_size=1000000&overrun_nonfatal=1&buffer_size=1000000' -vf scale=iw:ih -profile baseline -acodec aac -ac 1 -ar 44100 -ab 64k -deinterlace -vcodec h264_qsv -bufsize 4000k -maxrate 3500k -preset veryfast -vb 2000k -f flv rtmp://127.0.0.1/app/720 Now I tried to add the picture as a

VMSS with service fabric cluster autoscale

跟風遠走 提交于 2019-12-31 03:36:10
问题 I want to scale out or scale in the service fabric application. For this I have added the autoscalesettings with CPU metric on VM scale set. And in VM scale set, I have the extension section with wadcfg section with counter on CPU metric. And the data is successfully getting emitted to storage account which I have specified.But scale out or scale on options are not getting done with VMSS and service fabric cluster. I have gone through trouble shooting steps which were specified in azure

How to scale/position nodes Swift SpriteKit? Custom View?

血红的双手。 提交于 2019-12-31 01:46:34
问题 I'm working on a game but can't figure out the right way to scale/ position everything. I have a universal app and when I switch from device to device the nodes aren't in the right place everytime. I'm using AspectFill because it sizes my nodes the the right way for each device. The problem is the positioning. I don't know if I'm right in making the conclusion that I need to figure out how to make the view the same size as the screen so that it changes for each device and then positions and

LibGDX: Filtering a scaled TextureRegion

北城余情 提交于 2019-12-30 08:25:36
问题 I have several objects with different textures for different states, so I am using a TextureAtlas made with TexturePacker, and resizing the TextureRegion where I need it. I have to resize because not only am I trying to support both 720p and 1080p, but some of my objects are tiles or cursors which resize based on the width and height of the board, as that can change in my game whereas the board will always occupy the same percentage of the screen. With a Texture , I can just do this: texture

How to scale and position watermark to scale?

坚强是说给别人听的谎言 提交于 2019-12-30 05:30:08
问题 I'm scaling a video and applying a watermark like so: ffmpeg -ss 0:0:0.000 -i video.mp4 -y -an -t 0:0:10.000 -vf \"[in]scale=400:316[middle]\" -b:v 2000k -r 20 -vf 'movie=watermark.png,pad=400:316:0:0:0x00000000 [watermark];[middle] [watermark]overlay=0:0[out]' out.flv However, the applied watermark seems to be scaled to the original video size rather than the smaller scaled video size. This command line worked on ffmpeg version 0.8.6.git and now behaves differently after an upgrade to

Vertx scaling the number of instances per thread

你。 提交于 2019-12-30 02:29:08
问题 Vert.x is a tool-kit for building reactive applications on the JVM. I want to use vertx for JVM-based auto-scalable RESTful backend API. So far what I've found from the documentation, that it takes by default the number of cores in your machine, let's say you have N cores and creates N threads for each core, each thread is a event bus, each thread contains vertx instances. The question is, how does Vertx control the number of instances? based on load-pressure? This thing about control over

Scaling AR pictures based on the distance from the camera

只愿长相守 提交于 2019-12-29 09:34:15
问题 I’m developing an augmented reality iPhone app. What it should basically do is display pictures assigned to geographical locations when you look at them by the camera. Each such picture may be understood as a billboard which has its geographical position and a heading (understood as an angle between its plane and the north direction axis). The goal is to make these billboards display more or less like they were physical objects. They should be larger if you are close to them and smaller when