Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 20/10/21 in Posts

  1. Passo a passo de como indentar um código que veio sem indentação: Exemplo qualquer: 1. Adicione 4 espaços em tudo que estiver dentro da função principal, exceto a própria função e o end dela. Ela deve ficar assim: 2. Adicione mais 4 espaços em tudo que estiver depois do primeiro if, exceto o penúltimo end que pertence a ele. 3. Faça o mesmo com todos os if que tiverem dentro deste, um de cada vez. Vale lembrar que isso se aprende ao estudar lógica de programação e algoritmos. Curtiu este conteúdo? Achou ele útil para você ou para alguém? Deixe seu like neste tópico clicando no coração abaixo. \/
    1 point
  2. This is probably because of a text on raster optimisation. It is probably trying to place parts of the character on top of full pixels instead of 2 (half) pixels with opacity at 50%. This optimisation will probably be skipped when you enable the subPixelPositioning parameter. But this might make the readability harder (for low res) and more blurry. The solution The_GTA gives you would probably be the best fix. Or if you want to stay in control: https://wiki.multitheftauto.com/wiki/WordWrap
    1 point
  3. Try setting the clip and wordBreak parameters of dxDrawText to true. They are false by default.
    1 point
  4. thank you very much! now I understand that. but what wrong with my dxDrawText? i tried this: dxDrawText("ezegynagyonnagyonhosszúszövegleszmost",283*sx, 205*sy, 500 * scale, 700 * scale,tocolor(255,255,255,255),scale*1,customfont,"center") the text position the position of the text is perfect, but the font size too high for some resolutions, therefore, it does not fit in the rectangle and sticking out
    1 point
  5. That is because of screen ratio difference. This is how it works: 1920px | 1080px = 16:9 ratio 1920 / 16 = 120 120 * 9 = 1080! 2560px | 1080px = 21:9 ratio 2560 / 21 = 121,9047619047619‬.... 121,9047619047619‬.... * 9 = 1080 So if you apply your ratio to to a 1920x1080 resolution: 2560 / 16 = 160‬ 160‬ * 9 = 1440!!!!! You will be stretching the thing you want to scale. So in order to fix that problem. You want to go for the smallest dimensions which is the Y axis! 1920 x 1080 2560 x 1080 1080 x 1080 is a square which fits in both screens. The scale will be 1 for both resolutions. Squares have the ratio 1, which is a good normalizer. If the resolution was: 1280 × 720 720 / 1080 = 0,666666 scale The scale will go down because there are less pixels needed to cover up the same area. How does that looks like in the code: local sx_, sy_ = guiGetScreenSize() local sx, sy = sx_/2560, sy_/1080 local scale = sy -- I have defined this variable with the value of sy, so you do not confuse them later on. function teszt() dxDrawRectangle(140*sx, 200*sy, 700 * scale, 700 * scale,tocolor(0,0,0,165)) end addEventHandler("onClientRender",root,teszt) Golden rules (for keeping things in proportion? Position: X position = sx Y position = sy Scaling: X scaling = sy Y scaling = sy Offset from position: X offset = sy Y offset = sy Note: Sometimes for responsive layout you do not want to keep things in proportion. Like making the UI bigger for wider screens and show more elements, which you otherwise had to scroll to.
    1 point
  6. Guys go to any GitHub repository and press the period (.) key in your keyboard. Watch the magic happens... https://github.com/multitheftauto/mtasa-resources
    1 point
  7. This is an amazing effort done by SKC Vanilla staff, for making an amazing FORMULA 1 type-like event on MTA:SA - here are the video from the official race, they converted maps, they did scripts by their own. As a classic race player i'm proud of what they did. Tell me, if you like that also ;)
    1 point
×
×
  • Create New...