Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Replacing pixels in GM7 question  (Read 1058 times)

0 Members and 1 Guest are viewing this topic.
Replacing pixels in GM7 question
« on: August 28, 2009, 05:50:29 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Is it possible to replace/changes pixels on sprites with code in-game?

MMF2, if you got the exact RGB values of a color on a sprite, you could replace all the identically colored pixels with a new color.

So like with my old Megaman 4 competition demo, the charge up animation was actually not an animation.  I just cycled through the ol' NES colors by changing certain pixels' colors every so often.

Just wondering if GM can do that.
Logged
  • Super Fan Gamers!
Re: Replacing pixels in GM7 question
« Reply #1 on: August 28, 2009, 06:06:14 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
It can, but doing it would not be easy, as far as I'm aware as gm doesn't use palettes.  Essentially what you would have to do is draw the sprite on to a surface, go through each pixel and draw over the ones that match, then save that surface to a sprite.

Edit: heres another way it can be done http://www.gmlscripts.com/script/sprite_replace_color
« Last Edit: August 28, 2009, 08:49:09 am by Windy »
Logged

Mamoruanime

@Mamoruanime
Re: Replacing pixels in GM7 question
« Reply #2 on: August 28, 2009, 07:43:01 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
The function you're looking for is like replace_color() or color_replace() or something. It exists; I used it for my old Rockman and Protoman game from years back.
Logged
Re: Replacing pixels in GM7 question
« Reply #3 on: August 28, 2009, 09:13:09 am »
  • 笑い男
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2124
Yeah, in gm6. In gm7 you need to do it manually. There are ways, but they're very slow :(
Logged

この世に悪があるとすれば、それは人の心だ
  • .hack//The World
Re: Replacing pixels in GM7 question
« Reply #4 on: August 28, 2009, 10:19:35 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Damn, I was hoping for a quick color switch for different tunics instead of having to essentially make more sprites that are the same as the others -.-
Logged
  • Super Fan Gamers!
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.305 seconds with 48 queries.

anything