Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mecablaze

Pages: [1]
1
Graphics / Pun
« on: March 16, 2011, 06:41:37 am »
The code's getting better, by Jove!

 :lol:

2
Graphics / Tint an Image
« on: March 14, 2011, 06:14:41 pm »
Sorry about the confusion.

For example, if I want to tint my white image to RGB(255, 0, 255) (assuming the source image is white, per color theory).




In XNA, there is a tint parameter easily accessible (documentation).

3
Graphics / Tint an Image
« on: March 13, 2011, 11:00:11 pm »
I am using SFML2 in Visual Studio 2010 (Windows). See this post for more background information.

I was looking through the sf::Image documentation and I didn't see anything about tinting an image. I previously used SDL, in which tinting is very easy. I have a white sprite with alpha that I would like to tint one of three colors then copy it onto another image.

What is the best way to do this in SFML2?

4
Graphics / Clarification
« on: March 12, 2011, 04:08:11 pm »
Quote from: "Laurent"
You don't need RenderImage/Sprite to do so, you can simply use Image::Copy.

Just to be clear (I'm still pretty new to game programming), I should open up my old image editing program (I'm using Paint.NET) and create all the card possibilities, save them to a couple of new sprite sheets and those into memory via Image::LoadFromFile? Where does Image::Copy come in, during that process?

5
Graphics / RenderImage vs. Juggling a Handful of Sprites
« on: March 12, 2011, 03:10:09 am »
Okay, so I am working on a card game in SFML2 (I'm on Windows using Visual Studio 2010). I have a sprite sheet containing different graphics used to generate each card in the deck used for my game (symbols and card backs). I have an XML file defining where each individual sprite in the sprite sheet resides. All that is working fine.

I would like to generate all possible cards using the different symbols and card backs in my sprite sheet (i.e. I have an object Card which represents a single unique card). For the sake of example, think of having a sprite sheet with a club, heart, spade, and diamond on it with a white rectangle for a card back.

I would like to generate each possibility in a deck of cards. I can think of three ways to do this, I just don't know which one is the easiest and (more importantly) most efficient:
[list=1]
  • Have the Card object maintain multiple sprites, one representing the card back, the rest representing each symbol on the card, etc. (this means adjusting multiple sprites' coordinates as the card itself moves around)
  • Render the card back then symbols to a RenderImage and store that unique image for each Card object. This solution seems to lose the efficiency gained by having a sprite sheet (having only one image in the video memory)
  • Somehow subclass sf::Drawable for the symbols to allow for relative coordinates to the parent (the card itself) to allow easier drawing
  • [/list:o]
    I have tried this project with SDL (I created a seperate surface for each card) and XNA (I basically calculated the symbols' position at each draw).

Edit: I just wanted to leave a note and say that I'm totally geeking about SFML right now. It's a great project and orders of magnitude more usable than SDL.

Pages: [1]
anything