Wow, this looks amazing! Keep up the good work!
@quo_sp: check your personal messages
@quo_sp: check your personal messages

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
void Map::calculateTiles() {
// Tile X/Y position
int x, y, id;
float posX, posY, startX, startY, a, b, c = IntToFloat(this.tileSize) * screen.zoom;
if (abs(screen.rotation) > 90.0) { // mirror map when rotation is between +-90.0 and +-180.0
screen.mirrored = true;
}
else {
screen.mirrored = false;
}
// calculate sides a and b of a triangle (trigonometry)
a = Maths.Sin(Maths.DegreesToRadians(screen.rotation)) * c;
b = Maths.Sqrt(c * c - a * a);
if (screen.mirrored) {
b = -b;
}
// Tile Z position (height)
float tileSizeHalf = c / 2.0;
float rectDiag = Maths.Sqrt(tileSizeHalf*tileSizeHalf + tileSizeHalf*tileSizeHalf);
float rectAngle = Maths.ArcTan2(tileSizeHalf, tileSizeHalf);
float rot = Maths.DegreesToRadians(screen.rotation);
float tlX = (-rectDiag) * Maths.Cos(rectAngle + rot);
float tlY = (-rectDiag) * Maths.Sin(rectAngle + rot);
while (x < this.rows) {
posX = startX;
posY = startY;
while (y < this.cols) {
posX += b;
posY += a;
_tile[id].tlX = FloatToInt(posX + tlX, eRoundNearest);
_tile[id].tlY = FloatToInt(posY + tlY - _tile[id].z * screen.zoom, eRoundNearest);
y++;
id++;
}
y = 0;
x++;
startX -= a;
startY += b;
}
}
void Map::draw(bool drawGround) {
int id, t = FloatToInt(IntToFloat(this.tileSize)*screen.zoom);
drGroundLayer = Room.GetDrawingSurfaceForBackground();
drGroundLayer.Clear();
drGroundLayer.DrawingColor = 15;
while (id < this.maxTiles) {
if (_tile[id].tlX < screen.offsetX - t || _tile[id].tlX > screen.offsetX + System.ScreenWidth + t
|| _tile[id].tlY < screen.offsetY - t || _tile[id].tlY > screen.offsetY + System.ScreenHeight + t) {
}
else {
/* if (drawGround) {
drGroundLayer.DrawingColor = 11;
//####
drGroundLayer.DrawingColor = 15;
}*/
if (id == this.maxTiles-1) { } // don't draw last tile
else if (((id+1) % this.cols) == 0) { // just draw one vertical line for each tile of the last column
drGroundLayer.DrawLine(_tile[id].tlX - screen.offsetX, _tile[id].tlY - screen.offsetY,
_tile[id+this.cols].tlX - screen.offsetX, _tile[id+this.cols].tlY - screen.offsetY);
}
else if (id > (this.cols * (this.rows-1) - 1)) { // just draw one horizontal line for each tile of the last row
drGroundLayer.DrawLine(_tile[id].tlX - screen.offsetX, _tile[id].tlY - screen.offsetY,
_tile[id+1].tlX - screen.offsetX, _tile[id+1].tlY - screen.offsetY);
}
else { // draw one horizontal and one vertical line for each of the other tiles
drGroundLayer.DrawLine(_tile[id].tlX - screen.offsetX, _tile[id].tlY - screen.offsetY,
_tile[id+1].tlX - screen.offsetX, _tile[id+1].tlY - screen.offsetY);
drGroundLayer.DrawLine(_tile[id].tlX - screen.offsetX, _tile[id].tlY - screen.offsetY,
_tile[id+this.cols].tlX - screen.offsetX, _tile[id+this.cols].tlY - screen.offsetY);
}
}
id++;
}
drGroundLayer.Release();
}
//Put this in GlobalScript:
void Fade (this GUI*, bool fadeIn)
{
int t = this.Transparency;
if (fadeIn) {
while (t >= 0) {
this.Transparency = t;
t--;
Wait(1);
}
this.Clickable = true;
}
else {
while (t <= 100) {
this.Transparency = t;
t++;
Wait(1);
}
this.Clickable = false;
}
}
// Put this in GlobalHeader:
import void Fade (this GUI*, bool fadeIn=true);
// And then everytime you want to fade your GUI call:
gGuiName.Fade(true); //FadeIn
gGuiName.Fade(false); //FadeOut
Quote from: tzachs on Mon 01/11/2010 18:47:49Or (better), like the find window in Firefox, that actually isn't a window, but integrated into the GUIQuote from: Ryan Timothy on Mon 01/11/2010 17:16:02
I haven't downloaded this, but if you're working on the Find/Replace, it would be nice if the window didn't take focus. So that you can find a certain keyword, off click from the Find window, edit the line in the script editor and continue with the Find window.
It would be super cool if the window would be at half transparency or something when you're off clicked from it.
That's a nice suggestion, I'll see if I can implement it.
[else] if (button == eMouseRight) {
gMyGuisName.Visible = true;
}
GUITexto.Text = "New item taken.";
GUITexto.Text = String.Format("%s taken.", item.name);
if(IsTimerExpired(1)) {
GUITexto.Text = "";
}
SetTimer(1, (5*40)); // 40 loops per second
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.116 seconds with 14 queries.