2013 - 6 - 18 / 1:29 pm / general
SFML Text Pixel Fix
Yesterday I posted about an annoying little bug in the SFML Text class which displays a stray pixel on the upper left hand corner of the first character of the string.
Right now the theory is that this section of code is responsible. After some discussion with some smart people, a temporary work around was found.
When the font texture is created, apparently it will create the texture based on the string that you're using. If your string starts with "Q" then the first letter of the texture will be "Q", and since SFML also creates a 2x2 set of pixels on the upper left of the texture, those pixels will be visible at certain positions because of pixel interpolation.
The work around is to first create a dummy text class that starts with a character that you'll never use. In my code I'm using a random ascii character. I'll probably never ever use that ascii character in my text, so if the white pixel is inside the character then it doesn't matter since I will never use it!
After the dummy text character is created then you're safe to create your intended text object -- as long as you're using the same font and character size, that is! So make sure for each combination of font and character size you're creating a dummy text instance. You never have to draw the dummy text, just draw your actual intended text.
This is kind of a sketchy work around, but for now as far as I can tell it totally works.
I posted a thread on the SFML forum documenting this as well.
2013 - 6 - 17 / 2:51 pm / general
Dev Log: SFML Text Woes
My most recent development is getting text working in my SFML based framework. Unfortunately I've run into some sort of problem with the text rendering though.

Whenever I render text, there seems to be a tiny artifact that appears on the upper left corner for the first character of the string, but it only appears in certain positions. The artifact seems to be less than a pixel since moving it around the screen causes it to flicker on and off. In this example I'm rendering text 9 times, 8 times for the outline, and once for the center, and you can see the artifact also rendered 9 times in the top left corner of the Q character.

This is happening independent of fonts, and characters. The only instance I have seen this not occur is when the text is never moving on the screen, or when the first character actually occupies the upper left corner of its bounding box (for example the Y character in Arial.)
Does anyone out there know what's going on here and how I can fix it? If it makes any difference, currently my framework renders everything to a render texture which is then drawn to the window... not sure if this has anything to do with it, but I've been running tests with just drawing SFML text straight to the window with similar results so far.
Programming!
2013 - 6 - 6 / 8:35 pm / general
Dev Log: Parallax and Repeating
Just churning away at my SFML framework that I'm building with C#. The past two days I've added parallax scrolling (similar to Flashpunk's scrollX and scrollY variables) to images, as well as the ability for images to repeat. The cool thing about the repeating is that it's being done at the base image class, so even animated sprites can be repeated across the screen!

Also if you're working with SFML C# yourself, you should check out this TextureAtlas class written by Mark J. A. Smith. I have yet to implement something like this in my framework yet because I haven't really noticed performance issues, but using texture atlases can greatly reduce the amount of texture switching between drawing things, which helps a lot with performance.
Back to work!
2013 - 6 - 1 / 12:08 pm / general
Screenshot Saturday: Shaders!

BEHOLD I have finally implemented a shader! (It's actually just the example blur shader that comes with SFML.)
Ever since I started working on Snapshot I've always wanted to take advantage of pixel shaders for 2d games, and now with C# and SFML I've been able to finally do it. I'm pretty excited for where this can take me, but now I have to actually learn how to write GLSL shaders which looks pretty tough...
2013 - 5 - 31 / 2:45 pm / general
Dev Log: Animations
Finally got back into C# yesterday and refactored a bunch of my drawing code. I'm basically trying to take SFML and wrap it in a framework that resembles Flashpunk. Last night I got some animations working and I tested with my simple tilemap, and a familiar face from Offspring Fling!

SFML is still proving to be super fun and easy to work with so far, especially since I'm using C#. Also for you C# developers check out Glide, which looks to be a super neato replacement for TweenLite in AS3. I'm planning on implementing it into my framework soon.
I've also been trying to figure out if texture atlasing is necessary with SFML and I can't seem to find any resources on the matter... that is one of the items on my to do list for this framework!
2013 - 5 - 28 / 1:56 pm / general
Workstation!

I've been kinda busy with other stuff lately so unfortunately I don't have any super cool blog posts lined up for this week (yet.) Hopefully I'll be diving back into C# and SFML next week, so for now enjoy the picture of my workstation. (Actually this was taken back in December, so there are some things missing.) This is what I've been using to work on games and watch speed runs for the past 6 months!
about
Hi there, my name is Kyle, and I'm a 27 year old kid with adult powers. I'm making video games and living the indie game developer life in Tempe, Arizona. Here you will find my thoughts, games, websites, doodles, and other stuff like that. I worked on Snapshot, Offspring Fling, and a whole bunch of other games. If you want to get a hold of me use the form on the bottom of the page, leave a comment, or just tweet at me. I try to post three times a week. Thanks for stoppin' by!
spotlight
blog stuff
categories
tags
- actionscript
- air
- alec holowka
- art
- artxgame
- as3
- bill pullman
- blog
- csharp
- depict1
- design
- dev log
- devlog
- diet
- doodles
- flash
- flashdevelop
- flashpunk
- food
- gaiadi
- game jam
- gamedev
- gdc
- glsl
- good times
- haxe
- haxepunk
- id4
- igh
- internet
- ios
- jottobots
- namiko
- ninja slash
- nme
- offspring fling
- paleo
- pax
- pax10
- php
- pipa
- podcast
- programming
- promotion
- python
- sfml
- shaders
- snapshot
- sopa
- space sushi
- speedrun
- steam
- sushi
- tools
- uat
- verge
- webdev
- winnitron
- yay!
archives
- june 2013 (8)
- may 2013 (14)
- april 2013 (15)
- march 2013 (13)
- february 2013 (15)
- january 2013 (3)
- december 2012 (1)
- november 2012 (2)
- october 2012 (1)
- september 2012 (4)
- august 2012 (1)
- july 2012 (1)
- may 2012 (1)
- april 2012 (1)
- march 2012 (1)
- february 2012 (1)
- january 2012 (1)
- november 2011 (2)
- september 2011 (1)
- july 2011 (1)
- june 2011 (1)
- may 2011 (1)
- april 2011 (2)
- march 2011 (4)
- february 2011 (4)
videos
Do you want to make a Let's Play of one of my games, or a just a video featuring footage of my games? You have my full permission to do so! Even if you are monetizing your videos, you still have my full permission to use any footage from any of my games. Go for it!