Menu

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.

Show posts Menu

Topics - Junkface

#1
I've been having some issues where if I attempt to resize a character's current frame as a dynamic sprite it doesn't actually update onscreen. Here's the code I'm using:

Code: ags
void  CorrectSize(this  Character*)
{
  ViewFrame *CharacterFrame=Game.GetViewFrame(this.View, this.Loop, this.Frame);
  if(CloudsNew[this.ID].Sprite!=null)
  {
    CloudsNew[this.ID].Sprite.Delete();
  }
  CloudsNew[this.ID].Sprite=DynamicSprite.CreateFromExistingSprite(CloudsNew[this.ID].FromGraphic, true);
  CloudsNew[this.ID].Sprite.Resize(CloudsNew[this.ID].Width, CloudsNew[this.ID].Height);
  CharacterFrame.Graphic=CloudsNew[this.ID].Sprite.Graphic;
}

Hopefully, that's not too confusing - cloudsnew is just a struct where I'm storing all the extra variables relating to my character extender functions. If I add a line setting an object's graphic to CharacterFrame.Graphic the object graphic does change as I'd expect (so the frame itself is being resized correctly), but the character remains unchanged. Strangely, if I use a drawing surface on the dynamic sprite, then the character will update, but not otherwise. Is there some command I should be running in order for the character to update its graphic? I'm using CustomRes build 3.3.0, if that's relevant.

Thanks, and apologies if I'm missing something silly.
#2
I'm toying with converting my game from 8-bit to 16-bit, largely for the sake of smooth scaled sprites, and am getting black edges around the sprites (as though fading to a black background):


Is this the result of not having an alpha channel and unavoidable, or am I doing something stupid?

Thanks.
#3
Completed Game Announcements / Like A Dream
Sun 25/05/2014 13:09:18

I've made a short game about the twentieth century and the broken promises of modernism and the machine age. It's designed to rely more on mood and imagery than puzzles, but I've tried to design it to be fairly responsive to player input, while maintaining the sense of inevitability of a dream.

It can be downloaded from here.

Thanks to all those who've responded to my queries on the technical forums.

Any feedback on the game would be appreciated.
#4
I'm getting an instant of blackness when changing rooms. Transition is set to instant. I thought perhaps I had too much going on in the room_Load() functions but am having the same issue in a newly created, almost empty game. Increasing colour depth resolves things, but my game is quite reliant on palette effects. Can anyone suggest a solution or is this a known issue I have to learn to accept?

Thanks.
#5
Hi,

I'm making a game where I want to use dynamic sprites to change the appearance of objects a lot. I was hoping to do this with one function to create a different dynamic sprite for all the objects and other functions to then manipulate the dynamic sprite associated with whatever individual object is being worked with later, i.e. something like this (with [SceneryCurrent] representing the ID of the object being worked with):

Code: ags

scale[SceneryCurrent] = DynamicSprite.CreateFromExistingSprite(object[SceneryCurrent].Graphic); 
object[SceneryCurrent].Graphic=scale[SceneryCurrent].Graphic;


Code: ags

scale[SceneryCurrent].Resize(FloatToInt(SpriteSizeX[SceneryCurrent]), FloatToInt(SpriteSizeY[SceneryCurrent]));


scale0, scale1, scale2, etc are already defined as dynamic sprites in the global variables section but when I try to compile I get the error "Undefined token 'scale' ". Is there some means of working with dynamic sprites in the way I'm attempting or will I need to resort to something like:

Code: ags

if(SceneryCurrent==1){
  scale1.Resize(FloatToInt(SpriteSizeX[SceneryCurrent]), FloatToInt(SpriteSizeY[SceneryCurrent]));
}

if(SceneryCurrent==2){
  scale2.Resize(FloatToInt(SpriteSizeX[SceneryCurrent]), FloatToInt(SpriteSizeY[SceneryCurrent]));
}


I hope that's at least somewhat clear and would appreciate any advice anyone can give.

Thanks.
SMF spam blocked by CleanTalk