Jump to content

Drawing in fabulous world !


Emilio_M

Recommended Posts

Posted

You mean that you want to draw something in a world position, but you want it to keep the same scale?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Okay thanks. But now, i want to draw a progress bar, how to calculate the correctly position with the % of the progress bar with distance included. ?

Thanks.

Posted
width = actualWidth - ( actualWidth * (distance/maxDistance) ) 
height = actualHeight - ( actualHeight * (distance/maxDistance) ) 

Previously known as MrTasty.

Posted

Here is my idea its also work :

1: You get the x position of the rectangle when the progress is 100%(eg: 345)

2: you do this calculation

100% -> 345

X -> ?

? =( 345÷100)*X

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted
width = actualWidth - ( actualWidth * (distance/maxDistance) ) 
height = actualHeight - ( actualHeight * (distance/maxDistance) ) 

Thanks it's good !

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...