Tag Info

New answers tagged

0

The dimensions of the Stage (and the parent Group containing the Display Objects) is equal to the absolute value of the combined dimensions and positions of every Display Object in the Group, on the Stage, and in the World. Example: if you have a World that is 100 (width) x 100 (height) but bounded to -50, -50, 50, 50 such that 0,0 is in the center of the ...


2

Alexandre gave a good answer. I thought I'd take a stab at a concrete example. The example is is C#, but hopefully it is general enough to be implemented in any language you choose to use. using System; using System.Collections.Generic; public class SimpleGraph { private int _numberOfCities; private int[] _paths; public SimpleGraph() { ...


8

I would suggest you start by building a node graph (a bunch of nodes and arcs (sometimes called edges)). The nodes are the cities and "dash" intersection The arcs link cities and "dash" intersection Then all these nodes have info like their 'physical' location (x/y coordinates on the map). To solve your issues: you use the position that are set in ...


0

Or for people using XNA when the system is flipped. First calculate the mouse cursor in the world. Since the mouse position system in XNA is flipped subtract the mouse Y from the height of the screen. var mouseinWorld = new Vector2( (cursor.X * oldZoomLevel) - world.X, ((cursor.Y - screen.Height) * oldZoomLevel) + world.Y)); Now change your ...



Top 50 recent answers are included