sprite

Sprites sequence control through DeltaTime

谁说胖子不能爱 提交于 2019-12-18 09:48:31
问题 Previously in my main loop of the game, the time was managed at 60 FPS and the respective Delay for the time delay. The Sprite sequence was animated as follows: <pre> if(++ciclos > 10){ siguienteSprite++; ciclos = 0; } </pre> Given that I am using Smooth Motion with DeltaTime, therefore I have eliminated Delay from the Main Cycle; Making this the sprites cycles of the animation are faster, and not only this, but also the time between each sequence varies. Someone could give me a hand, only

Unity 2D C# Instantiate sprite on canvas. Can't find what's wrong

给你一囗甜甜゛ 提交于 2019-12-18 07:14:29
问题 I read many questions about this, but I still can't find what my problem is... I'm trying to instantiate a prefab at the canvas. It is compose of a button and a sprite. The button looks ok, but the sprite is not visible at the Game (but is visible at the Scene). I'm doing something wrong, but I can't see what... [SerializeField] GameObject finishedLevel; private void Start() { finishedLevel = Instantiate(finishedLevel, transform.position, transform.rotation); finishedLevel.transform.SetParent

IE11 making background image text blurry

半城伤御伤魂 提交于 2019-12-17 20:19:16
问题 I'm working on a website, where I use image sprites on a button. In every other browser I've tried, except for IE11, the text on my sprite is crisp as it should be, but in IE11, the text gets blurry (See images). The blurry one being IE11 ofc. The width of the sprite is 189px and the height is 378px. I use the following CSS: button { width:189px; height:189px; background-image:url('../images/kontakt-os.png'); background-position: top; cursor:pointer; border-radius: 100px; } button:hover {

cocos2d sprite repeat animation forever

假装没事ソ 提交于 2019-12-17 19:56:06
问题 In my iOS game, I hope the hero keep running until screen is touched and the hero should jump. So I write: In .h file: @interface Hero : CCSprite { CCSprite *_hero; id _keepRunning; } @property(nonatomic,retain) id keepRunning; In .m file: @synthesize keepRunning = _keepRunning; -(id) init { _keepRunning = [CCRepeatForever actionWithAction:[CCAnimate actionWithSpriteSequence:@"heroRun%04d.png" numFrames:30 delay:0.02f restoreOriginalFrame:NO]]; } Then when the game starts, I call run ()

Three.js: how to keep sprite text size unchanged when zooming

*爱你&永不变心* 提交于 2019-12-17 16:37:28
问题 In three.js, when the mouse is zoomed, the text will be magnified and reduced accordingly. var texture = new THREE.Texture( canvas ); var material = new THREE.SpriteMaterial ( { map: texture, transparent:false } ); var sprite = new THREE.Sprite( material ); How do you keep the text size from changing when the mouse is zoomed? 回答1: My default, sprites scale according to their distance from the perspective camera -- just like other objects do. If you do not want them to scale, you can overlay a

sf::Texture as class member doesn't work?

北战南征 提交于 2019-12-17 14:52:20
问题 Heyy, I want to draw a sprite in my SFML application but its texture is always white when I use an image and a texture that are class members Class members: sf::Sprite myimg; sf::Image myimg_image; sf::Texture myimg_texture; When I then create the sprite like this in my cpp file // create image myimg_image.create(icon.width, icon.height, icon.pixelData); // create texture from image myimg_texture.create(icon.width, icon.height); myimg_texture.update(myimg_image); // apply texture to sprite

Detecting collision of two sprites that can rotate [duplicate]

牧云@^-^@ 提交于 2019-12-17 03:44:11
问题 This question already has answers here : How to check intersection between 2 rotated rectangles? (10 answers) Closed 5 years ago . I have a problem with collision detection in a 2D Java game. Normally, what I would do is create a getBounds() method for an object that can collide with other objects. This method would return a new Rectangle(x,y,width,height) , where x and y are the coordinates for the top-left corner of the sprite, and width and height are the width and height of the sprite.

C++/SFML display glitch with sprite member changed by mouseclick

一笑奈何 提交于 2019-12-14 03:54:45
问题 I am learning C++/SFML and as a practice exercise I am making a small program that dispalys a 10x10 grid of 64x64 px square brown sprites in a window. This program allows you to select green/yellow/blue/grey/brown square sprites using the keyboard and replace any tile on said grid with this selected sprite. Game loop below: while (window.isOpen()) { window.clear(sf::Color(sf::Color::Black)); sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) window.close()

Controlling and creating multiple sprites array Java Libgdx

时光怂恿深爱的人放手 提交于 2019-12-14 02:14:12
问题 I am trying to create a game which has sprites and every second another is spawned, i tried using this as a base: https://github.com/libgdx/libgdx/wiki/A-simple-game However when the new one spawns in it destroys the old one and they start to spawn faster and faster. Here is the relevent code: ownCreate method: Array<Rectangle> chickens; chickens = new Array<Rectangle>(); spawnChicken(); New Spawn Chicken method: private void spawnChicken() { int choice; choice = MathUtils.random(0, 3);

Removing MANY CCSprites

隐身守侯 提交于 2019-12-13 21:09:18
问题 Hey guys and girls. I have a method that creates rain particles, tiny images, of CCSprite class type. Everything is working well, when the clouds rain, they rain many particles of CCSprites until they leave the vertical winsize space.. Once they do leave the vertical winsize space, the iphone simulator begins to lag as it removes each rain CCSprite. I think the problem is that their are so many CCsprites to remove, not the actual demand of having them in the memory. My method to remove