Search Results

Search found 658 results on 27 pages for 'sprites'.

Page 17/27 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How does Silverlight Image Clipping work?

    - by TreeUK
    I've got a very large image which I'd like to use for sprite techniques (à la css image sprites). I've got the code below: <Image x:Name="testImage" Width="24" Height="12" Source="../Resources/Images/sprites.png"> <Image.Clip> <RectangleGeometry Rect="258,10632,24,12" /> </Image.Clip> </Image> This clips the source image to 24x12 at the relative position of 258, 10632 in the source image. The problem is that I want the cropped image to show at 0,0 in the testImage whereas it shows it at 258, 10632. It's using the geometry as a cutting guide but also as a layout guide. Anyone have any idea how this should be done? if at all. Conclusion: There seems to be no good way of doing this at present, Graeme's solution seems to be the closest to achieving this with Silverlight 2.0. That said, if anyone knows of a better way of doing this, please reply with an answer.

    Read the article

  • Should I use OpenGL for chess with animations?

    - by fhucho
    At the moment I am experimenting with SurfaceView for my chess game with animations. I am getting only about 8 FPS in the emulator. I draw a chess board and 32 chess pieces and rotate everything (to see how smooth it is), I am using antialiasing. On the Droid I'm getting about 20FPS, so it's not very smooth. Is it possible to implement a game with very scarce and simple animations without having to use OpenGL? This is what I do every frame: // scale and rotate matrix.setScale(scale, scale); rotation += 3; matrix.postRotate(rotation, 152, 152); canvas = surfaceHolder.lockCanvas(); canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.FILTER_BITMAP_FLAG)); canvas.setMatrix(matrix); canvas.drawARGB(255, 255, 255, 255); // fill the canvas with white for (int i = 0; i < sprites.size(); i++) { sprites.get(i).draw(canvas); // draws chessboard and chess pieces }

    Read the article

  • How did the Lunar Lander example make the image backgrounds transparent?

    - by user279112
    Hello. I'm trying to make a GUI program with the Android SDK, using their Lunar Lander example as a significant self-teaching tool in the process. I've noticed their sprites' images' backgrounds, which were at least usually pure white, did not show up in their program. I want to ask how they did that, since their site doesn't explain simple things very well. I've managed to pull that off before on another GUI SDK, wherein all I had to do was to call a function and pass it a few floats to define a certain color, and until my code told it to do otherwise, that function would make sure that that particular color in my sprites' images was totally transparent. However I've wrestled with the Lunar Lander example and getting my own program to show some custom graphics for a week or two now, and I haven't noticed any such function call in the Lunar Lander example. I tried to look for it, but I did not find anything. I've tried to Google some tutorial or other reference material, but what I've found so far is just straying off into unrelated areas and totally dodging this EXTREMELY important lesson on the SDK's basics. Any ideas? Thanks!

    Read the article

  • Turning off antialiasing in Löve2D

    - by cjanssen
    I'm using Löve2D for writing a small game. Löve2D is an open source game engine for Lua. The problem I'm encountering is that some antialias filter is automatically applied to your sprites when you draw it at non-integer positions. love.graphics.draw( sprite, x, y ) So when x or y is not round (for example, x=100.24), the sprite appears blurred. The same happens when the sprite size is not even, because (x,y) points to the center of the sprite. For example, a sprite which is 31x30 big will appear blurred again, because its pixels are painted in non-integer positions. Since I am using pixel art, I want to avoid this all the way, otherwise the art is destroyed by this effect. The workaround I am using so far is to force the coordinates to be round by littering the code with calls to math.floor(), and forcing all the sprites to have even sizes by adding a row or column of transparent pixels with the paint program, if needed. Is there some command to deactivate the antialiasing I can call at program startup?

    Read the article

  • Collision Detection (Ground & Slopes) in 2D Platform Game using Pygame Rects

    - by RedCap
    Hi, First off, I am not after any instructions on logic for collision detection; I get it. What I am trying to work out is the least complicated way to do this with Pygame using Sprites & Rects. I want to be able to check collisions for the Player against ground, walls & slopes. In theory it is quite straight forward, but I'm having difficulty because it seems like you cannot do this with one Rect. One Rect is simple enough to get you collisions in the X plane against walls. The same Rect could be used also be used in the Y plane against solids, but not with slopes - since with the collision routines in Pygame it checks the whole Rect (or mask), rather than perhaps just the bottom middle of the Rect. It seems in addition you need to have a number of "sprites" to check collisions with, that are 1x1 pixel in various places around the Player. What's the easiest way to do this, without having a bunch of 3, 4, or more separate "collision pixels" to check against slopes? Geoff

    Read the article

  • Pause que in Windows Video?

    - by thomas
    Is therer a way to make pause ques in Windows Media Video, like sprites in Quicktime? I want to be able to run a wmv file in Windows Media Player that stops automaticly on a text, then I click and the film starts again and goes on to the next text and stops, and so on.

    Read the article

  • Is S3 cheaper than a EC2 DIY solution (for small files)

    - by Jann
    Is it really cheaper to host images and scripts via S3 than with an EC2 instance running nginx/varnish/etc. ? It seems to me (but i'm just getting started with AWS) that the request costs will be the major factor if you don't use sprites or other optimizations... or am i missing something ?

    Read the article

  • Alpha issue with SharpDX SpriteBatch in WPF

    - by Kingdom
    .Hi devs, I'm coding a game using SharpDX in a WPF context. void Load() { sb = new SpriteBatch(GraphicsDevice); t2d = Content.Load<Texture2D>("Sprite.png"); } void Draw() { sb.Begin(); sb.Draw(t2d, new Rectangle(0, 0, 64, 64), Color.White); sb.End(); } I made Sprite.png, an object with pink color (alpha = 0%) for the background. The output show me my object but with the pink square at more or less 50% rate! So if I try to draw more sprites, it's like a little poney dream. Note If I apply Color.Black on the Draw method, the sprite is like expected :|

    Read the article

  • Advice for creating fog of war on tilemap game XNA

    - by Sigh-AniDe
    I have created a 2D Tile Based game. The game has a single path that the sprite can move on. I want to create to make the entire screen black except for where the sprite is. The sprite has commands such as left where he keeps looking left, right where he keeps looking right and move forward where he moves in the direction he is looking. I want to make it such that when he looks left then the tile on the left of the sprites fog should be removed and so on for all the sides. What is the best way to do this? Is there any tutorials that you guys know of that i can take a look at? Thanks

    Read the article

  • Setting Higher Z-Index for Sprite

    - by Siddharth
    For my game, I have to set highest z index for my sprite. At present, I wrote following code but didn't work for me. Sprite houseSprite = new Sprite(pX, pY, textureManager.houseBgRegion.deepCopy(), mVertexBufferObjectManager); attachChild(houseSprite); houseSprite.setZIndex(500); sortChildren(); My requirement did not satisfied with setting sprite in the HUD. So any how I have to apply highest z index. Also in my game sprites are dynamically generated as per game play. So members please share your thoughts.

    Read the article

  • Algorithm to make groups of units

    - by M28
    In Age of Mythology and some other strategy games, when you select multiple units and order them to move to some place, they make a "group" when they reach the desired location: I have a Vector with several sprites, which are the selected units, the variables tarX and tarY are the target x and y. I just want an example, so you can just set the x and y position and I can adapt it to my code. Also, I would like to ask that the algorithm calls "isWalkable" for the x and y position, to determine if it's a valid position for each unit.

    Read the article

  • OpenGL ES 2.0: Vertex and Fragment Shader for 2D with Transparency

    - by Bunkai.Satori
    Could I knindly ask for correct examples of OpenGL ES 2.0 Vertex and Fragment shader for displaying 2D textured sprites with transparency? I have fairly simple shaders that display textured polygon pairs but transparency is not applied despite: texture map contains transparency information Blending is enabled: glEnable(GL_BLEND); glEnable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); My Vertex Shader: uniform mat4 uOrthoProjection; uniform vec3 Translation; attribute vec4 Position; attribute vec2 TextureCoord; varying vec2 TextureCoordOut; void main() { gl_Position = uOrthoProjection * (Position + vec4(Translation, 0)); TextureCoordOut = TextureCoord; } My Fragment Shader: varying mediump vec2 TextureCoordOut; uniform sampler2D Sampler; void main() { gl_FragColor = texture2D(Sampler, TextureCoordOut); }

    Read the article

  • Keeping crosshairs & GUI onscreen - SFML

    - by nihohit
    I read this question, but didn't understand the implementation suggestions with SFML on c#. For example, right now I'm just trying to make sure that the mouse crosshairs stay onscreen constatnly. I tried using this code: View lastView = this._mainWindow.GetView(); this._mainWindow.SetView(this._mainWindow.DefaultView); this._mainWindow.Draw(crosshair); this._mainWindow.SetView(lastView); after drawing all other sprites and before call this._mainWindow.display(), when beforehand I set crosshair.Position based on its position relative to the window, not the view. This just keeps the screen locked and prevents screen scrolling. Any suggestions?

    Read the article

  • A few meta questions about making flash games

    - by idan
    A few questions for a beginner game maker without an artist. Is there a site where flash game creators can download (and use) free art? I don't need character sprites but environments like trees, clouds, platforms, etc. Is there a site where a programmer can collaborate with an artist and a composer? (Even if so, the chances are low for a beginner with no portfolio to find an artist willing to collaborate, right?) Do you have recommended sites for asking action script questions (dedicated solely to flash?) Thanks!

    Read the article

  • javascript game loop and game update design

    - by zuo
    There is a main game loop in my program, which calls game update every frame. However, to make better animation and better control, there is a need to implement a function like updateEveryNFrames(n, func). I am considering implementing a counter for each update. The counter will be added by one each frame. The update function will be invoked according to the counter % n. For example, in a sequence of sprites animation, I can use the above function to control the speed of the animation. Can some give some advice or other solutions?

    Read the article

  • Entity/Component based engine rendering separation from logic

    - by Denis Narushevich
    I noticed in Unity3D that each gameObject(entity) have its own renderer component, as far I understand, such component handle rendering logic. I wonder if it is a common practice in entity/component based engines, when single entity have renderer components and logic components such as position, behavior altogether in one box? Such approach sound odd to me, in my understanding entity itself belongs to logic part and shouldn't contain any render specific things inside. With such approach it is impossible to swap renderers, it would require to rewrite all that customized renderers. The way I would do it is, that entity would contain only logic specific components, like AI,transform,scripts plus reference to mesh, or sprite. Then some entity with Camera component would store all references to object that is visible to the camera. And in order to render all that stuff I would have to pass Camera reference to Renderer class and render all sprites,meshes of visible entities. Is such approach somehow wrong?

    Read the article

  • Performance of pixel shaders vs. SpriteBatch: XNA

    - by ashes999
    Precondition: I read this question/answer about using shaders, or spritebatch, to render and mark a sprite. I need to do something like that. I also have a 2D lighting PoC which I need to write. The way it will work will basically be something like: Draw all the sprites Draw lighting gradients to create a lighting texture Multiply/add the lighting texture to achieve different effects (I use multiple passes of add/multiply the lighting texture to achieve different effects.) My question is really about a generalization: can I say with certainty that pixel shaders are always faster than adding/multiplying textures to the SpriteBatch? Or that adding/multiplying is always faster? Or if it's not generalizable, how do I decide which approach to take, given that I can probably code either of them? (If it matters, I'm using MonoGame 3.0 beta for Windows games)

    Read the article

  • Will I have an easier time learning OpenGL in Pygame or Pyglet? (NeHe tutorials downloaded)

    - by shadowprotocol
    I'm looking between PyGame and Pyglet, Pyglet seems to be somewhat newer and more Pythony, but it's last release according to Wikipedia is January '10. PyGame seems to have more documentation, more recent updates, and more published books/tutorials on the web for learning. I downloaded both the Pyglet and PyGame versions of the NeHe OpenGL tutorials (Lessons 1-10) which cover this material: lesson01 - Setting up the window lesson02 - Polygons lesson03 - Adding color lesson04 - Rotation lesson05 - 3D lesson06 - Textures lesson07 - Filters, Lighting, input lesson08 - Blending (transparency) lesson09 - 2D Sprites in 3D lesson10 - Moving in a 3D world What do you guys think? Is my hunch that I'll be better off working with PyGame somewhat warranted?

    Read the article

  • Cocos2D 2.0 - masking a sprite

    - by Desperate Developer
    I have read this tutorial about how to mask sprites using Cocos2D 2.0. http://www.raywenderlich.com/4428/how-to-mask-a-sprite-with-cocos2d-2-0 But the author talks about OpenGL ES textures and vertices as they were common knowledge. My knowledge about OpenGl is zero raised to infinity. All I want is to use a rectangle to mask a sprite to it. How I would do in Photoshop using a rectangle as mask (yes, I want to clip a sprite to the rectangle bounds and no, I do not want to use the ClippingNode solution, that do not works for animation/scaling etc.). So, can you guys translate the klingon language used in this tutorial and tell how a solid rectangle can be used to mask a sprite in Cocos2D? I am desperate, as my username states. I am searching this for a week and have tried several solutions without satisfactory results. Please help me. Thanks!

    Read the article

  • Tile-based maps in AS3

    - by Ashley
    I want to make a tile-based platformer in AS3. I want my game to read an external maps file (in xml or json or somethimg similar) to draw a tile-based map. I've seen loads of tutorials for this in AS2 and other languages, and the few I've found in AS3 are either incomplete or filled with extra unnecessary features. I just want to be able to draw a basic map from sprites in Flash. Any links or information to point me in the right direction would be appreciated.

    Read the article

  • The best tile based level design [on hold]

    - by ReallyGoodPie
    My current method for tile based levels is to put everything in an array like the following: grass = g sky = s house = h ... """ ["SSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"], ["SSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"], ["HHHHHHHHHHHHHHSSSSSSSSSSSSSSSS"], ["GGGGGGGGGGGGGGGGGGGGGGGGGGGGGG"], """ I would then run a for loop to pass these on to a sprite class, bliting the images to the screen. This is what I'd generally do in pygame when I am creating levels for a tile based RPG's. However, as I've gone on, I have added allot more sprites and image and it is seriously becoming more and more confusing to work with this and allot of mistakes are being made. What is the best alternative or other methods for doing this?

    Read the article

  • GLSL Bokeh using Quads and Textures

    - by Notoriousaur
    I'm trying to create a depth of field effect with bokeh sprites in GLSL. Specifically, what i would like to do is, for each pixel: See if the pixel is out of the focal range If it is, draw a quad and apply a texture to provide a bokeh sprite. This kind of implementation is seen in the Unreal Engine and by Matt Pettineo, however, both implementations are in DX11 and I'm using OpenGL. I'm a bit stuck on the drawing a quad and applying a texture bit. Does anyone know how I can do this, or provide any relevant links as to how I can do this? Thanks

    Read the article

  • Migration from XNA to SharpDX

    - by Wouter
    My fear is that XNA has reached the end of the road. To keep up with the latest technology a shift to another game framework might be needed. We have many games in a large codebase, all based on XNA. My question is, how much work would it be to migrate to SharpDX and are there other possibilities? Our code base mainly uses basic 3D rendering and the SpriteBatch, no fancy shader stuff. Update: I should have mentioned we only use 2.5D, we have a simple engine that builds textured quads to render text and animated sprites. Also for sound we use XACT (what else..) with some effects.

    Read the article

  • Are there any good html 5 mmo design tutorials?

    - by Dwight Spencer
    Hey all. I got a rather inspired after playing gaia online's zOMG and wanted to revive an old project idea I've had laying around for a few years now. I'm looking to work with html5 (ie canvas, svg based sprites, & WebGL) to build a graphical web based MUD/MMO. Obviously, this is a new take on an old idea and after searching google I haven't really turned up many good resources. But does anyone have any tutorials or other resources to point me in the right direction?

    Read the article

  • Absorbtion 2d image effect

    - by Ed.
    I want to create a specyfic 2d image effect. It consists in modifying a sprite so it looks like it is being zoomed to a point or "absorbed" by that point. I'm not really sure what is the technical name of this effect so I cannot explain it correctly. Here you can see a video of what I'm talking about, it is the effect when the character absorbs the three glyphs. http://www.youtube.com/watch?v=PIo-GddsMcU&t=4m45s What is the name of this effect? How can I implement it with XNA for 2D textures/sprites?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >