• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Damnwing0405
      I am looking for talents to form a team of making a strategy base action game. Talents I am currently looking for are : -
      (I) Unity programmer (mobile)
      (II) Game designer
      (III) 3d Artist
      (IV) SFX Artist
      The attachment is some game concept for the game. All the concept will be turn into 3d or card form. The game will be strategy game where the players can form their own team and control the units in the battle field real time to fight against each others.  If you are interested to know more details please pm me or send an email to damnwing0405@gmail.com

    • By bsudheer
      Leap Leap Leap! is a fast-paced, endless running game where you leap from rooftop to rooftop in a computer simulated world.

      This is a free run game and get excited by this fabulous computer simulated world of skyscrapers and surreal colors in parallax effect. On your way, collect cubes and revival points as many as you can to make a long run.

      Features of Leap Leap Leap:
      -Option of two themes: Black or White.
      -Simple one touch gameplay.
      -Attractive art.
      -Effective use of parallax.
      To Download the game:
      Playstore: https://play.google.com/store/apps/details?id=com.avakaigames.leap
      Appstore: https://itunes.apple.com/us/app/leap-leap-leap/id683764406?mt=8

    • By BillyGD

      Play Flick Football 3D @ https://gamejolt.com/games/flickfootball3d/326078
      Check out our Facebook page @ https://www.facebook.com/FlickFootball3D/
      Flick Football 3D is a turn based football game inspired by the table top classic 'Subbuteo'.
      The game is currently in very early Alpha development. There is still a lot to be done before the first proper release but I have decided to release this playable version to get as much feedback as possible.
      The only game mode currently available in this release is the 'Practice Mode' which gives you control of both teams. Either play against yourself to get used to how the game works or play against friends and family on the same computer!
      Planned Future Features Include:
      -Take control of your own custom team in the single player campaign.
      -Play in online leagues and tournaments against other players in the multiplayer mode.
      -Fully customisable stadiums to make you stand out from the rest of the players.
      -Improve your players stats and skills by playing matches and setting up training sessions.
      Flick Football 3D is available for Windows, Mac and Browser.
      Thank you for viewing my game, all feedback is greatly appreciated. I can be contacted at; BillyGDev@outlook.com
      'Flick Football 3D' is also the development name for the game and I haven't yet decided what the full release will be called, so if you have any ideas please drop me a message!
    • By drcrack
      It is a combination of fundamental RPG elements and challenging, session-based MOBA elements. Having features such as creating your unique build, customizing your outfit and preparing synergic team compositions with friends, players can brave dangerous adventures or merciless arena fights against deadly creatures and skilled players alike.

      This time with no grinding and no pay to win features.

      We're still looking for:
      1) 3D Character Artist
      2) 3D Environment Artist
      3) Animator
      4) Sound Designer
      5) VFX Artist

      Discord https://discord.gg/zXpY29V or drcrack#4575
    • By Francisco Tufr
      Hi everyone! I'm currently working on a series of books about 2D Shader Development.

      The idea is to synthesize a bunch of techniques that are specifically useful for 2D, even if they work on 3D as well.

      I released the first book last week. It's 4.99 on Amazon or free on the series website, https://www.2dshaders.com

      This is an independent initiative, I don't work for any publisher whatsoever. The contents of the books are the result of a 4-year span where I started teaching this in Argentina and USA, always making the workshop better. Now I'm expanding it to make more sense in book form.

      I'd love to hear your opinions on the idea and if you get the book let me know what you think.

      By the way, the examples are in Unity, but the concepts from the book should be easily transferable to any graphics api/engine.

      Hope you like it!
  • Advertisement
  • Advertisement
Sign in to follow this  

Unity [.net] Sprite Scale in vers: 1.0.2902.0

This topic is 4828 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings Everyone, This is my first post to the community and don’t believe it to be my last... I am a beginning game developer and have gained a real respect for game programmers over the last few months... (this is tough stuff). Wished I'd have paid more attention in math class. In any event, I've run into a problem that has beaten me up pretty good. I have looked everywhere for some kind of hint and found none... so here I am… posting to the forum. Before I whacked my box I was running Direct3D version: 1.0.900.0 I am now running VS 2003, framework 1.1.4322, and DirectX: 1.0.2902.0 I am working with the Sprite object in Direct3D (all in Managed C#). Now, before I whacked my box and installed the latest (and greatest?) versions, I was making a call to the Draw function like this:
public void Draw(Sprite d3dSprite) {
   if (isVisible) {
      d3dSprite.Draw(this.Texture,	// Source Texure
      new Rectangle(0,0,width,height),// Source Rectangle
      new Vector2(scale,scale),	// Scaling
      new Vector2(width/2f,height/2f),// Rotation Center
      visualAngle,			// Rotation
      position,				// Translation
      Color.White.ToArgb());		// Alpha (?) Color

But, in this newest version (1.0.2902.0), they've changed it. "Scaling" is now "Destination Rectangle". There is a huge difference between these two methods for scaling the Sprite. The 'old' method of Scaling actually drew the Sprite X many pixels larger (or smaller). But this new method "destRect" seems to be making the pixels larger. (thus keeping the same size in pixels) I wish that I could explain what I am experiencing better. It seems that the 'old' Scaling scaled the sprite in screen coordinates while the new destRect is scaling it in some other way (maybe object coordinates?) I want to scale the sprites in the 'old' manner. Meaning: when I tell a 100 pixel sprite (in actual screen pixels) to be 2x as large, I want the sprite to render at 200 pixels (actual screen pixels). Not 100 pixels that are twice as large. Lol does this make sense? I hope someone can help, this one problem has held me up for 4 long days. Ok, cool, I'm excited to be apart of this community and am eager to learn anything you wish to share. [Edited by - ElectricBliss on October 9, 2004 11:11:47 PM]

Share this post

Link to post
Share on other sites
I thought I’d post my current solution. I skipped trying to use the Sprite’s transforms and just used a matrix instead. Please let me know if there is a more elegant solution.

public void Draw(Sprite d3dSprite) {
if (isVisible) {
Matrix m = new Matrix();
m.Transform(new Vector3(0f,0f,0f),//scale Center
new Quaternion(0f,0f,0f,0f), //scaling rotation
new Vector3(ScaleX,ScaleY,0f), //scaling factor
new Vector3(0f,0f,0f), //rotation center
new Quaternion(0f,0f,0f,0f), //rotation
new Vector3(X,Y,0f)); //translation

d3dSprite.Transform = m;

d3dSprite.Draw(this.Texture, //texture
new Rectangle(0,0,width,height), //source rectangle
new Vector3(0f,0f,0f), //center
new Vector3(0f,0f,0f), //position
Color.White); //alpha color

[Edited by - ElectricBliss on October 10, 2004 11:43:56 PM]

Share this post

Link to post
Share on other sites
Original post by ElectricBliss
...Wished I'd have paid more attention in math class...

Sorry that I can't comment on the Sprite.

If you are trying to get started, a good book helps a great amount. My book had an introduction to matrices, vectors and quaternions. It was with DX 8 so you probably don't want the name.
(I am good at maths in the additional set in my school where we learn some A level maths as well as GCSE, but we only used vectors and matrices for simple translation (no dot/cross products or anything!) and we have certainly not done quaternions :~})

Share this post

Link to post
Share on other sites
Greetings all,

Just thought I'd update ya on the scaling with Matrices. Just use the Transform2D function to KISS:

Matrix m = new Matrix();
m = Matrix.Transformation2D(
new Vector2(0f,0f), //scaleCenter
0f, new Vector2(ScaleX, ScaleY),//scaling rotation, scaling
new Vector2(0f,0f), //rotation center
this.rotation, //rotation
new Vector2(X,Y)); //translation
d3dSprite.Transform = m;

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement