Game Development Community

Here is how to change the default Filter Mode when adding new ImageMaps

by Chris Hoopes · in Torque Game Builder · 01/19/2013 (6:13 pm) · 4 replies

My game's style relies on the hard edges of all of its images so I got real tired of changing the filter mode of any ImageMap we added from SMOOTH to NONE. If anyone else wants to know how to do this:

  1. Open up Torque 2D Pro 1.7.6enginesourceT2Dt2dImageMapDatablock.cc
  2. For TGB 1.7.6 you'll see the constructor t2dImageMapDatablock() at line 225
  3. Change line 227 mFilterMode(T2D_FILTER_BILINEAR), to mFilterMode(T2D_FILTER_NEAREST),
  4. Recompile and relaunch!
Now all of your new ImageMaps will have those nice hard pixels preserved by default!

#1
01/20/2013 (9:01 am)
Nice!
But we still need to add images 1 by 1 by hand.
#2
01/20/2013 (1:00 pm)
I'm not sure what you mean by that. After clicking "Create a new ImageMap" in TGB you can select multiple files from the Open dialog by using shift or control-click like anywhere else in Windows. I haven't tried it in OSX but it should work the same way there.
#3
01/20/2013 (7:39 pm)
Duh. Why didn't I think of that? I've been picking them one by one this whole time...
#4
01/21/2013 (5:27 am)
Ha-ha, me too. Not anymore!