Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2019-12-28, 15:06


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4185 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

B??d: c.lua:19: attempt to compare nil with number

function isMouseInPosition(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then -- 19 linijka
        return true,cx,cy
    else
        return false
    end
end

Przyk?ad wywo?ania:
isMouseInPosition(screenW * 0.4656, screenH * 0.4435, screenW * 0.0693, screenH * 0.1130)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-12-28, 15:42


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Zdefiniowales sx i sy?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-12-28, 15:49


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4185 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

Tak
local sx, sy = guiGetScreenSize()


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-12-29, 23:09


THEGizmo

Modeler/Uczeń Lua






Wiek: 28
Na forum: 4282 dni
Posty: 255
Nick w MP: THEGizmo

Piwa: 3091

Respekt: 200
Respekt: 200Respekt: 200

P.Wi?nia, Sprawd? tera

function isMouseInPosition(psx, psy, pssx, pssy)
    if not isCursorShowing() then return end
    local cursorx, cursory = getCursorPosition()
    local screenx, screeny = guiGetScreenSize()
    cx, cy = cursorx*screenx, cursory*screeny
    if cx > psx and cx < psx + pssx and cy > psy and cy < psy + pssy then
        return true
    else
        return false
    end
end


licz? na :piwo: or R*

Postaw piwo autorowi tego posta
 

 
Tagi: znajdowanie :: pozycji :: myszki.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku