sprite

C# directx sprite origin

六月ゝ 毕业季﹏ 提交于 2019-12-31 03:32:29
问题 i have this problem when my Sprite rotation origin is fixed at top left corner of window (same with sprite.Draw and sprite.Draw2D ) Either way if i change rotation center it's still at top left. I need sprite to rotate around its Z axis. Edit: I have tried this: hereMatrix pm = Matrix.Translation(_playerPos.X + 8, _playerPos.Y + 8, 0); sprite.Transform = Matrix.RotationZ(_angle) * pm; sprite.Draw(playerTexture, textureSize, new Vector3(8, 8, 0), new Vector3(_playerPos.X, _playerPos.Y, 0),

Puzzled by my sprite's unequal +/ - velocity

♀尐吖头ヾ 提交于 2019-12-31 02:59:04
问题 I have two sprites in my game. The zombie sprite works perfectly, moving in all directions at a velocity of 1.0. My player sprite however, despite moves more slowly in the positive x/y direction, despite all values in all directions being 2.25. For the life of me I can't seem to see what is wrong here. Full working code: import pygame import random import sys import itertools import math import time from datetime import datetime from librarymodified import * from pygame.locals import * #

Fading in/out GameObject

断了今生、忘了曾经 提交于 2019-12-27 11:51:59
问题 I'm fairly new to coding, I'm still trying to develop that logic of thinking to help me create the solutions I'm wanting for games. Currently, I'm in Unity trying to create a 2D GameObject that's a wall hiding a secret door. I want that GameObject to fade out (about 90%) when the player GameObject triggers it, revealing the space behind and the hidden door. So far, I've managed to figure out how to render the "secret wall" GO inactive on the trigger, so it disappears, but this doesn't produce

Fading in/out GameObject

流过昼夜 提交于 2019-12-27 11:51:33
问题 I'm fairly new to coding, I'm still trying to develop that logic of thinking to help me create the solutions I'm wanting for games. Currently, I'm in Unity trying to create a 2D GameObject that's a wall hiding a secret door. I want that GameObject to fade out (about 90%) when the player GameObject triggers it, revealing the space behind and the hidden door. So far, I've managed to figure out how to render the "secret wall" GO inactive on the trigger, so it disappears, but this doesn't produce

Fading in/out GameObject

非 Y 不嫁゛ 提交于 2019-12-27 11:51:23
问题 I'm fairly new to coding, I'm still trying to develop that logic of thinking to help me create the solutions I'm wanting for games. Currently, I'm in Unity trying to create a 2D GameObject that's a wall hiding a secret door. I want that GameObject to fade out (about 90%) when the player GameObject triggers it, revealing the space behind and the hidden door. So far, I've managed to figure out how to render the "secret wall" GO inactive on the trigger, so it disappears, but this doesn't produce

Why can't I erase my Sprite

那年仲夏 提交于 2019-12-25 09:26:17
问题 I've been trying for a while now to get a game working in Java, after much anguish over other peoples Sprite functions I made my own and don't understand why I can't erase it. I know it's changing the pixels of the background to display my archer sprite since it shows up but for whatever reason I can't change the pixels back to what they were before. Does anyone have an idea why that is or how I can fix it? Link to google doc with images: https://docs.google.com/document/d/1eU6faW1d7valq1yE

Listen to click event on overlapped sprites

前提是你 提交于 2019-12-25 08:15:52
问题 I have two sprites in my movieclip, one under the other, and i want both to listen to mouse clicks event. I found that only the top level sprite receives the event when i click on it. I need to dispatch the events on both, so I can't use mouseenabled=false. Is there a simple workaround for this? 回答1: You can use the ' getObjectsUnderPoint ' method native to the DisplayObjectContainer You can see how it works here: http://snipplr.com/view/34945/as3-trace-movieclips-under-mouse/ and the AS3

ANDROID ANDENGINE — drag and drop stacked sprites

亡梦爱人 提交于 2019-12-25 06:25:49
问题 in my app I have some sprites that i need to drag and drop over the display. i defined the BitmapTextureAtlas and the corresponding TextureRegion, and then i'have created the draggable sprite from those data. Some sprites must be set in the same position and they have to be stacked. everything works fine except that the sprites seams to be stacked but when i touch an drag away one, instead of dragging the first on the top, it makes me drag away always the first on the bottom. how can i fix it

is there a way to set a jbutton on top of a jbutton?

旧街凉风 提交于 2019-12-25 05:00:51
问题 I am wondering about this since we are making a game in Swing and we made our map tiles into jButtons instead of jPanels for whatever reason. Now we want to put units on top of them so the map background is still shown when the unit is on top of them. Anyone know if this is possible? 回答1: OK, so I am not sure this is really what you are looking for and how your application is currently set up, but this is an example to have JButtons on top of each other (if this is not what you are looking

Animating the sprite array created from texture atlas

十年热恋 提交于 2019-12-25 04:13:32
问题 I have created a sprite array from texture atlas like this. playerSprite = atlas.createSprites("player"); Inside texture atlas, player regions are named as player01 , player02 and player03 . playerAnimation = new Animation(0.5f, playerSprite); playerAnimation.setPlayMode(PlayMode.NORMAL); and I rendered it like this. batch.draw(playerAnimation.getKeyFrame(animTime,true), ninja.getX(),ninja.getY(), ninja.getWidth(),ninja.getHeight()); When I execute, this throws an error. "Exception in thread