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 MenuQuote from: Pumaman on Sun 14/09/2008 15:03:45here:Quote1 BUG: Importing a single sprite with any corner as transparent, changes all black pixels in the sprite to the color of the corner pixels.
1 SUGGESTION: When importing multiple sprites, I would like to be able to choose the transparency settings once for all of them.
Can you post a sample image file that causes the bug?
QuoteI know that but its not very comfortable with many animations. Because I have some with alpha-transparency, some with blue/pink transparent areas, some with transparent pixels only on the bottom left/right. So I always have to import a single sprite first before I can import the rest? Not very easy/fast.
As for multiple sprites, when you do a Quick Import Multiple Sprites it should use the transparency option that was last selected in the import window.
//in top of global script:
bool fadein;
bool fadeout;
int gTransparency;
int gID;
void Fade(this GUI*, FadeStyle style)
{
if (!fadein && !fadeout)
{
gID = this.ID;
if (style == eFadeIn)
{
fadein = true;
this.Visible=true;
gTransparency = this.Transparency;
SetTimer(20, 1);
}
else if (style == eFadeOut)
{
fadeout = true;
gTransparency = this.Transparency;
SetTimer(19, 1);
}
}
if (style == eStopFading)
{
SetTimer(20, 0);
SetTimer(19, 0);
fadein = false;
fadeout = false;
}
}
//////////////////////////////
//in global header
enum FadeStyle {
eFadeIn,
eFadeOut,
eStopFading
};
///Fades the gui in or out
import void Fade(this GUI*, FadeStyle style);
////////////////////////////////
function repeatedly_execute()
{
if (IsTimerExpired(20) && gTransparency >= 0 && fadein) //FADE IN
{
gui[gID].Transparency = gTransparency;
gTransparency-=3;
if (gTransparency > 0) SetTimer(20, 2);
else {
gTransparency = 0;
gui[gID].Transparency = 0;
fadein = false;
}
}
if (IsTimerExpired(19) && gTransparency <= 100 && fadeout) //FADE OUT
{
gui[gID].Transparency = gTransparency;
gTransparency+=3;
if (gTransparency >= 100)
{
gui[gID].Visible = false;
gTransparency = 100;
gui[gID].Transparency = 100;
fadeout = false;
}
else SetTimer(19, 2);
}
Hotspot *hot = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
if(hot == hotspot[0] && gDescription.Visible) //cursor on no hotspot
{
if (!fadeout) gDescription.Fade(eStopFading);
gDescription.Fade(eFadeOut);
}
if (hot != hotspot[0] && !fadein)
{
gDescription.Fade(eStopFading);
if(hot == hotspot[1])
{
lblDescription.Text = "Text for hotspot 1";
gDescription.SetPosition(20, 12); //changes its coordinates to be at the right position
}
else if (hot == hotspot[2]) //continue like this for the rest of the hotspots
{
lblDescription.Text = "Text for hotspot 2"; //You can use ttf fonts instead of the ags built in fonts
gDescription.SetPosition(123, 45);
}
.....
gDescription.Fade(eFadeIn);
}
}
gDescription.Visible = false;
gDescription.Transparency = 100;
//script header
struct coordinates
{
int x;
int y;
bool used;
};
import coordinates Point[MAX_POINTS];
//main script
coordinates Point[MAX_POINTS];
export Point;
Point[0].x = 12;
Point[0].y = 123;
...
//header
struct mem //in that struct you can add your functions for pair checking etc.
{
import void mix();
...
};
import mem Memory;
//script
mem Memory; //on top
export Memory;
mem::mix()
{
int i;
while (i < MAX_POINTS) { //reseting memory
Point[i].used = false;
i++;
}
i = 0;
int pos;
while (i < MAX_POINTS) { //mixing the cards
pos = Random (MAX_POINTS-1);
if (!Point[pos].used)
{
Point[pos].used = true;
object[i].SetPosition(Point[pos].x, Point[pos].y);
i++;
}
}
}
Memory.mix();
Quote from: Pumaman on Tue 12/08/2008 21:02:52QuoteWhen using an alpha transparent sprite as button image, it doesn't show correctly (even when the gui has an alpha channel). Only when the gui background image is fully transparent then the button image shows correctly as it should. (so my experience)
What do you mean, "doesn't show correctly"? Have you tried the new AdditiveOpacity option in the beta?
Quote from: scotch on Sun 10/08/2008 20:26:39I just had to modify the function name because ags says its already defined
Could use...
void Split(this String*, String separator, String array[])
{
int n = this.Length;
int start, stop, i;
while (start >= 0 && start < n)
{
stop = this.IndexOf(separator, start); //the second parameter is the startingIndex (from that index the function searches)
if (stop < 0 || stop > n) stop = n;
array[i] = this.Substring(start, stop);
start = this.IndexOf(separator, stop+1);
i++;
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.081 seconds with 14 queries.