Search Results

Search found 2771 results on 111 pages for 'andrew arrow'.

Page 2/111 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Box2d - Attaching a fired arrow to a moving enemy

    - by Satchmo Brown
    I am firing an arrow from the player to moving enemies. When the arrow hits the enemy, I want it to attach exactly where it hit and cause the enemy (a square) to tumble to the ground. Excluding the logistics of the movement and the spin (it already works), I am stuck on the attaching of the two bodies. I tried to weld them together initially but when they fell, they rotated in opposite directions. I have figured that a revolute joint is probably what I am after. The problem is that I can't figure out a way to attach them right where they collide. Using code from iforce2d: b2RevoluteJointDef revoluteJointDef; revoluteJointDef.bodyA = m_body; revoluteJointDef.bodyB = m_e->m_body; revoluteJointDef.collideConnected = true; revoluteJointDef.localAnchorA.Set(0,0);//the top right corner of the box revoluteJointDef.localAnchorB.Set(0,0);//center of the circle b2RevoluteJoint m_joint = *(b2RevoluteJoint*)m_game->m_world->CreateJoint( &revoluteJointDef ); m_body->SetLinearVelocity(m_e->m_body->GetLinearVelocity()); This attaches them but in the center of both of their points. Does anyone know how I would go about getting the exact point of collision so I can link these? Is this even the right method of doing this? Update: I have the exact point of collision. But I still am not sure this is even the method I want to go about this. Really, I just want to attach body A to B and have body B unaffected in any way.

    Read the article

  • XNA - Use Mouse To Rotate & Arrow Keys To Scroll A Linearly Wrapped Texture:

    - by The Thing
    Using XNA I'm working on my first, relatively simple, videogame for the PC. At the moment my game window is 1024 X 768 and I have a 'Starfield' linearly wrapped background texture 1280 X 1280 in size whose origin has been set to its center point (width / 2, height / 2). This texture is drawn onscreen using (graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 2) to place the origin in the center of the window. I want to be able to use the horizontal movement of the mouse to rotate my texture left or right and use the arrow keys to scroll the texture in four directions. From my own related coding experiments I have found that once I rotate the texture it no longer scrolls in the direction I want, it's as if somehow the XNA framework's 'sense of direction' has been 'rotated' along with the texture. As an example of what I've described above lets say I rotate the texture 45 degrees to the right, then pressing the up arrow key results in the texture scrolling diagonally from top-right to bottom-left. This is not what I want, regardless of the degree or direction of rotation I want my texture to scroll straight up, straight down, or to the left or right depending on which arrow key was pressed. How do I go about accomplishing this? Any help or guidance is appreciated. To finish up there are two points I'd like to clarify: [1] The reason I'm using linear wrapping on my starfield texture is that it gives a nice impression of an endless starfield. [2] Using a texture at least 1280 X 1280 in conjunction with a game window of 1024 X 768 means that at no point in it's rotation will the edges of the texture become visible. Thanks for reading..... Update # 1 - as requested by RCIX: The code below is what I was referring to earlier when I mentioned 'related coding experiments'. As you can see I am scrolling a linearly wrapped texture in the direction I've moved the mouse relative to the center of the screen. This works perfectly if I don't rotate the texture, but once I do rotate it the direction of the scrolling gets messed up for some reason. public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; int x; int y; float z = 250f; Texture2D Overlay; Texture2D RotatingBackground; Rectangle? sourceRectangle; Color color; float rotation; Vector2 ScreenCenter; Vector2 Origin; Vector2 scale; Vector2 Direction; SpriteEffects effects; float layerDepth; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } protected override void Initialize() { graphics.PreferredBackBufferWidth = 1024; graphics.PreferredBackBufferHeight = 768; graphics.ApplyChanges(); Direction = Vector2.Zero; IsMouseVisible = true; ScreenCenter = new Vector2(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 2); Mouse.SetPosition((int)graphics.PreferredBackBufferWidth / 2, (int)graphics.PreferredBackBufferHeight / 2); sourceRectangle = null; color = Color.White; rotation = 0.0f; scale = new Vector2(1.0f, 1.0f); effects = SpriteEffects.None; layerDepth = 1.0f; base.Initialize(); } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); Overlay = Content.Load<Texture2D>("Overlay"); RotatingBackground = Content.Load<Texture2D>("Background"); Origin = new Vector2((int)RotatingBackground.Width / 2, (int)RotatingBackground.Height / 2); } protected override void UnloadContent() { } protected override void Update(GameTime gameTime) { float timePassed = (float)gameTime.ElapsedGameTime.TotalSeconds; MouseState ms = Mouse.GetState(); Vector2 MousePosition = new Vector2(ms.X, ms.Y); Direction = ScreenCenter - MousePosition; if (Direction != Vector2.Zero) { Direction.Normalize(); } x += (int)(Direction.X * z * timePassed); y += (int)(Direction.Y * z * timePassed); //No rotation = texture scrolls as intended, With rotation = texture no longer scrolls in the direction of the mouse. My update method needs to somehow compensate for this. //rotation += 0.01f; base.Update(gameTime); } protected override void Draw(GameTime gameTime) { spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.LinearWrap, null, null); spriteBatch.Draw(RotatingBackground, ScreenCenter, new Rectangle(x, y, RotatingBackground.Width, RotatingBackground.Height), color, rotation, Origin, scale, effects, layerDepth); spriteBatch.Draw(Overlay, Vector2.Zero, Color.White); spriteBatch.End(); base.Draw(gameTime); } }

    Read the article

  • Arrow Presente : Oracle Solution Tour 2012

    - by swalker
    Tournée dans 6 villes à partir du 1er Décembre 1er décembre Strasbourg 6 décembre Lyon 7 décembre Aix en Provence 10 janvier Toulouse 12 janvier Nantes Contenu : Présentation de la Roadmap et de la stratégie Oracle L’accompagnement d’Arrow pour developper le Business Oracle Ateliers de certifications Oracle Sales,Presales et Support >> Pour en savoir plus

    Read the article

  • XKB - remap arrow keys and preserve shift behaviour to select text

    - by dgirardi
    I realize arrow key remapping is an old problem, however I cannot seem to find a good solution that lets me select text with SHIFT + remapped keys as I would do with the vanilla arrow keys. For instance, if I remap Caps Lock to ISO_Level3_Shift and set xkb_symbols to read either key <AC08> { [ k, K , Down, Down] }; or key <AC08> { type="THREE_LEVEL", [ k, K , Down ] }; Pressing Shift+CapsLock+K will behave exactly as CapsLock+K (while Shift+Down behaves differently from Down alone). I had somewhat more success using higher level macro utilities and generating keyboard events (i.e. generate both the shift and the arrow keypresses); hoever that approach has a whole set of different problems - often the UI response to a simulated keypress is different from the "real" keypress, and there are performance problems as well - I can type faster than the thing can handle. Tl;dr; how can you shift-select using remapped arrow keys under X?

    Read the article

  • Navigating Libgdx Menu with arrow keys or controller

    - by Phil Royer
    I'm attempting to make my menu navigable with the arrow keys or via the d-pad on a controller. So Far I've had no luck. The question is: Can someone walk me through how to make my current menu or any libgdx menu keyboard accessible? I'm a bit noobish with some stuff and I come from a Javascript background. Here's an example of what I'm trying to do: http://dl.dropboxusercontent.com/u/39448/webgl/qb/qb.html For a simple menu that you can just add a few buttons to and it run out of the box use this: http://www.sadafnoor.com/blog/how-to-create-simple-menu-in-libgdx/ Or you can use my code but I use a lot of custom styles. And here's an example of my code: import aurelienribon.tweenengine.Timeline; import aurelienribon.tweenengine.Tween; import aurelienribon.tweenengine.TweenManager; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputListener; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.utils.Align; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.project.game.tween.ActorAccessor; public class MainMenu implements Screen { private SpriteBatch batch; private Sprite menuBG; private Stage stage; private TextureAtlas atlas; private Skin skin; private Table table; private TweenManager tweenManager; @Override public void render(float delta) { Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); menuBG.draw(batch); batch.end(); //table.debug(); stage.act(delta); stage.draw(); //Table.drawDebug(stage); tweenManager.update(delta); } @Override public void resize(int width, int height) { menuBG.setSize(width, height); stage.setViewport(width, height, false); table.invalidateHierarchy(); } @Override public void resume() { } @Override public void show() { stage = new Stage(); Gdx.input.setInputProcessor(stage); batch = new SpriteBatch(); atlas = new TextureAtlas("ui/atlas.pack"); skin = new Skin(Gdx.files.internal("ui/menuSkin.json"), atlas); table = new Table(skin); table.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); // Set Background Texture menuBackgroundTexture = new Texture("images/mainMenuBackground.png"); menuBG = new Sprite(menuBackgroundTexture); menuBG.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); // Create Main Menu Buttons // Button Play TextButton buttonPlay = new TextButton("START", skin, "inactive"); buttonPlay.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { ((Game) Gdx.app.getApplicationListener()).setScreen(new LevelMenu()); } }); buttonPlay.addListener(new InputListener() { public boolean keyDown (InputEvent event, int keycode) { System.out.println("down"); return true; } }); buttonPlay.padBottom(12); buttonPlay.padLeft(20); buttonPlay.getLabel().setAlignment(Align.left); // Button EXTRAS TextButton buttonExtras = new TextButton("EXTRAS", skin, "inactive"); buttonExtras.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { ((Game) Gdx.app.getApplicationListener()).setScreen(new ExtrasMenu()); } }); buttonExtras.padBottom(12); buttonExtras.padLeft(20); buttonExtras.getLabel().setAlignment(Align.left); // Button Credits TextButton buttonCredits = new TextButton("CREDITS", skin, "inactive"); buttonCredits.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { ((Game) Gdx.app.getApplicationListener()).setScreen(new Credits()); } }); buttonCredits.padBottom(12); buttonCredits.padLeft(20); buttonCredits.getLabel().setAlignment(Align.left); // Button Settings TextButton buttonSettings = new TextButton("SETTINGS", skin, "inactive"); buttonSettings.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { ((Game) Gdx.app.getApplicationListener()).setScreen(new Settings()); } }); buttonSettings.padBottom(12); buttonSettings.padLeft(20); buttonSettings.getLabel().setAlignment(Align.left); // Button Exit TextButton buttonExit = new TextButton("EXIT", skin, "inactive"); buttonExit.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { Gdx.app.exit(); } }); buttonExit.padBottom(12); buttonExit.padLeft(20); buttonExit.getLabel().setAlignment(Align.left); // Adding Heading-Buttons to the cue table.add().width(190); table.add().width((table.getWidth() / 10) * 3); table.add().width((table.getWidth() / 10) * 5).height(140).spaceBottom(50); table.add().width(190).row(); table.add().width(190); table.add(buttonPlay).spaceBottom(20).width(460).height(110); table.add().row(); table.add().width(190); table.add(buttonExtras).spaceBottom(20).width(460).height(110); table.add().row(); table.add().width(190); table.add(buttonCredits).spaceBottom(20).width(460).height(110); table.add().row(); table.add().width(190); table.add(buttonSettings).spaceBottom(20).width(460).height(110); table.add().row(); table.add().width(190); table.add(buttonExit).width(460).height(110); table.add().row(); stage.addActor(table); // Animation Settings tweenManager = new TweenManager(); Tween.registerAccessor(Actor.class, new ActorAccessor()); // Heading and Buttons Fade In Timeline.createSequence().beginSequence() .push(Tween.set(buttonPlay, ActorAccessor.ALPHA).target(0)) .push(Tween.set(buttonExtras, ActorAccessor.ALPHA).target(0)) .push(Tween.set(buttonCredits, ActorAccessor.ALPHA).target(0)) .push(Tween.set(buttonSettings, ActorAccessor.ALPHA).target(0)) .push(Tween.set(buttonExit, ActorAccessor.ALPHA).target(0)) .push(Tween.to(buttonPlay, ActorAccessor.ALPHA, .5f).target(1)) .push(Tween.to(buttonExtras, ActorAccessor.ALPHA, .5f).target(1)) .push(Tween.to(buttonCredits, ActorAccessor.ALPHA, .5f).target(1)) .push(Tween.to(buttonSettings, ActorAccessor.ALPHA, .5f).target(1)) .push(Tween.to(buttonExit, ActorAccessor.ALPHA, .5f).target(1)) .end().start(tweenManager); tweenManager.update(Gdx.graphics.getDeltaTime()); } public static Vector2 getStageLocation(Actor actor) { return actor.localToStageCoordinates(new Vector2(0, 0)); } @Override public void dispose() { stage.dispose(); atlas.dispose(); skin.dispose(); menuBG.getTexture().dispose(); } @Override public void hide() { dispose(); } @Override public void pause() { } }

    Read the article

  • Using ctrl-arrow keys with PuTTY and screen

    - by kbosak
    I searched and couldn't find a solution for this anywhere. I'm using PuTTY from Windows to connect to various servers where I run bash and screen. It seems bash works fine with ctrl-arrow keys to jump word-to-word on the command line but within screen it's not working. Not in screen, ctrl-left sends "^[OC and ctrl-right is "^[OD". Within screen I instead get "^[[C" and "^[[D", which appears to be the codes for just the left/right arrow keys. Is there any way to get screen to recognize ctrl-arrow keys when using PuTTY? (FYI, I don't remember having this problem when using gnu-terminal in linux instead of PuTTY).

    Read the article

  • arrow keys stop working to scroll pages

    - by Delirium tremens
    Sometimes, the arrow keys stop working to scroll pages. Sometimes, in Firefox - Tools - Options - Advanced - Accessibility - General, the first checkbox, about using arrow keys to scroll pages, appears checked and some other times, unchecked. When it's unchecked, I check it. When it's checked, I keep it checked. In both times, I click OK. Then, the arrow keys restart working to scroll pages. I'm having to do it all the time. What should I do?

    Read the article

  • Using ctrl-arrow keys with PuTTY and screen

    - by kbosak
    I searched and couldn't find a solution for this anywhere. I'm using PuTTY from Windows to connect to various servers where I run bash and screen. It seems bash works fine with ctrl-arrow keys to jump word-to-word on the command line but within screen it's not working. Not in screen, ctrl-left sends "^[OC and ctrl-right is "^[OD". Within screen I instead get "^[[C" and "^[[D", which appears to be the codes for just the left/right arrow keys. Is there any way to get screen to recognize ctrl-arrow keys when using PuTTY? (FYI, I don't remember having this problem when using gnu-terminal in linux instead of PuTTY). UPDATE: It appears PuTTY is the problem as it is not sending the escape codes that are necessary for this to work. I'm giving up for now and using Cygwin+mintty.

    Read the article

  • How to handle ctrl+arrow in Javascript?

    - by MartyIX
    I've noticed an problem when trying to catch keyboard shortcut: CTRL+an arrow. I've handled keydown event. Now when I hold CTRL key then keydown event is fired once. If I hold an arrow (so that now I'm holding CTRL+an arrow) it doesn't fire another event. Is it forbidden from any reason? I guess I've already encountered this problem in Opera a few years ago and there was an option for it in browser. My results: holding CTRL, press an arrow -- fires event for CTRL and doesn't fire an event for an arrow press CTRL + an arrow at once -- fires one event but only with keycode of CTRL. holding CTRL, press a letter (eg. S) -- works as expected press CTRL + letter (eg. S) -- works as expected (Results are identical in Chrome and Firefox. Is the behaviour described above a standard?) I'm using: function OnKeyDown(e) { } e.ctrlKey, e.which properties of event The question is: what might be the problem?

    Read the article

  • Compiz shortcut with two arrow keys

    - by l0b0
    The "Put" functionality of CompizConfig Settings Manager is great. I'd like to be able to move windows to the desktop corners by using Super+Down/Up+Left/Right for this; is that possible? Whenever I try to set something like that it is just reset to "Disabled". A workaround is of course to use the numeric pad, but I'd like to be able to do this on my EEE laptop as well without enabling and disabling NumLock all the time.

    Read the article

  • sort arrow is always showing up once sorting is used

    - by kksachin
    we have several pages as tabs where datatable is used in most of the pages.when we sort on a particular coulmn and exit the page and re enter this page the arrow appears(up /down based on how we left) Although the data is not sorted in the direction the arrow shows.i have set preserveSort and preserveDataMode to false. The arrow is set to true in the column's t:commandSortHeader tag in all the pages. is this a bug or am i missing any setting?I have tried to set forceId to false in t:commandSortHeader but of now use.

    Read the article

  • Fn + Right Arrow on MacBook Pro does not work as END Key for SuperUser web site

    - by George2
    Hello everyone, I am using a MacBook Pro running Mac OS X 10.5. I am new to this development environment, and previously worked on Windows. I have tried that Fn + Right arrow on Mac works as "END" key on Windows -- which makes cursor move to the end of line, for most application like Word for Mac -- I have tried it works. But I tried Fn + Right Arrow does not work for current question input box of SuperUser. I am wondering how to solve this issue and why? Does anyone have the same issue for me? thanks in advance, George

    Read the article

  • Mapping Super+hjkl to arrow keys under X

    - by Bill Casarin
    I'm trying to map: Super+h -> Left Super+j -> Down Super+k -> Up Super+l -> Right globally under X. The idea is I don't want to leave my home row that often to use the arrow keys, so I'll use the Super modifier + hjkl to emulate the arrow keys under X. Is there any way to do this? One thing I've tried is xbindkeys + xte using this configuration: "xte 'keydown Up' 'keyup Up'" Mod4+k "xte 'keydown Down' 'keyup Down'" Mod4+j "xte 'keydown Left' 'keyup Left'" Mod4+h "xte 'keydown Right' 'keyup Right'" Mod4+l but there seems to a large delay between me pressing the key and noticing any result, and most of the time nothing happens at all. Is there a more elegant way of doing this that actually works with no delay?

    Read the article

  • Enable Ctrl (or Alt) + arrow keys to mimic 'home' and 'end' functionality

    - by YuKagi
    I am a long time Mac user and I'm now using a Ubuntu machine for development, and while I'm more or less used to a lot of the keyboard shortcuts, one thing I can't get used to is using the 'Home' and 'End' keys to move around lines of text. On a Mac you use "Command + right arrow" to go to the end of a line and "Command + left arrow" to go to the beginning. Is there a way to enable this kind of functionality in Linux? I'm not sure if this would be considered remapping, keyboard shortcuts, or what...

    Read the article

  • Mapping Ctrl+Arrow for Home/End/PageUp/Down

    - by user67275
    I'm using Windows 7 on Dell New Inspiron 14z Ultrabook. It doesn't have Home/End/PgUp/PgDn keys. Instead I have to use Fn + arrow keys. Can I re-map those to Ctrl + arrows or Alt + arrows or Shift + arrows? That way I could go one page up and down with only my right hands rather than with the left hand on the Fn key and right hand on arrow key. Also, volume up and down is assigned to FnF11 and FnF12. Can I re-map them to F11 and F12? Existing functions assigned to F11 and F12 will be replaced by FnF11 and FnF12. Is it possible?

    Read the article

  • Question about "ASP.NET 3.5 Social Networking" by Andrew Siemer (from Packt Publishing)

    - by user287745
    am currently reading a book, which has explanation of making a social website. ASP.NET 3.5 Social Networking https://www.packtpub.com/expert-guide-for-social-networking-with-asp-.net-3.5/book On page 41 I noticed that the images of the solution explorer given in the text, indicate that windowsformapplication[PROJECT] has been used instead of WebForms[create new website]. there are no webforms? how would the end result be a site? what is happening here?? the name of the book is, ASP.NET 3.5 Social Networking, please refer to page 41, thanks note:- i have always made websites which needs hosting and be accessible from other computers using webforms[create new website] which has web.config file app_data etc..... please help thank you.

    Read the article

  • Vim move cursor one character in insert mode without arrow keys

    - by bolov
    This might seem a little too overboard, but I switched to vim and I so happy about the workflow now. I try to discipline myself not to use the arrow keys, as keeping the hands on the alfa-keys all the time is such a big thing when writing. So when I need to navigate I get out of insert mode, move in normal mode and get back in insert mode. There is an exception where this is actually more disrupting: I use clang complete with snippets and super tab which is great. Except every time I get a function auto completed after I fill in the parameters I am left with the cursor before ) so to continue I have to move the cursor one character to the right. As you can imagine this happens very often. The only options I have (as far as I know) are : Escla or ?, and I am not happy about neither of them. The first one makes me hit 3 keys for just a simple 1 character cursor move, the second one makes me move my hand to the arrow keys. A third option would be to map CTRL-L or smth to ?. So what is the best way of doing this? //snippets (clang complete + supertab): foo($`param1`, $`param2`) //after completion: foo(var1, var2|) ^ ^ | | I am here | Need to be here | denotes cursor position

    Read the article

  • Alternative to arrow keys in Google Chrome location bar

    - by saltycrane
    I like Google Chrome because it is fast but I don't like using the arrow keys in the location bar to complete URLs. Is there any extension, or setting I'm missing, that allows me to use the Tab key (or other customizable key) for completion like in Firefox? I am an Emacs user and am aware of Conkeror. I just wanted to give Google Chrome a fair chance. Edit: I'm using version 4.0.266.0 on Linux.

    Read the article

  • Arrow keys don't work in htop on OS X in Terminal

    - by Daniel Huckstep
    Not sure when it happened, or what I did (if anything), but my arrow keys don't work in htop anymore to scroll around. You should be able to press up and down to scroll up and down the process list, but they don't work. Some keys tend to be the equivalent of 'go back' or something. If I'm on the settings screen, left, up and down all go back to the main screen. htop seems to be the only affected program.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >