Author Topic: Viewport  (Read 116 times)

Offline WPShadow

  • Prof. Inline
  • *****
  • Posts: 1313
    • View Profile
    • http://lostrevenant.blogspot.com
Viewport
« on: July 24, 2010, 01:14:42 pm »
Hi,

mal eine allgemeine Frage zu Viewport:

Wenn ich eine Mausabfrage einer 2D Graphik in einem "Viewport - Bereich" machen will, muß ich im Prinzip eine eigene MOUSESTATE - Abfrage darin machen, falls ich das richtig verstanden habe.

Blöderweise funktioniert das Ganze nicht so, wie ich es gerne hätte, denn auf die vorhandene Mausabfrage wird leider nicht reagiert!

Hier ein Code - Auszug:

Code: [Select]
LOCAL aktiv, vx, vy, v1, v2

//...einiger anderer Code, unabhängig von diesem Viewport, würde also bloß verwirren

VIEWPORT self.minimap_pos_x + 1, self.minimap_pos_y + 1, self.minimap_l - 2, self.minimap_b - 2

DRAWRECT 10, 10, 40, 40, RGB(255, 0, 0)

MOUSESTATE vx, vy, v1, v2

IF vx >= 10 AND vx <= 50 THEN END

IF v1 = 1 THEN END

VIEWPORT 0, 0, 0, 0


Auf vx reagiert das Ganze leider gar nicht, auf v1 jedoch schon! Wo mache ich hier genau den Fehler?

Bezieht sich Mousestate immer nur auf das Original - Bild, unabhängig von Viewport?

GLG

W.
« Last Edit: July 24, 2010, 04:07:40 pm by WPShadow »
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 8.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://www.lostrevenant.net
alea iacta est

Offline Kitty Hello

  • Useless Servant
  • Administrator
  • Prof. Inline
  • *****
  • Posts: 6768
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Viewport
« Reply #1 on: July 26, 2010, 10:13:26 am »
Ja. Mousestate gibt die Koordinaten in Bildschirm-Koords zurück, nicht in Viewport Koords.
DELL Precision M6300: Core 2 Duo 2.20GHz, 2GB ram, NVIDIA Quadro FX 1600M, Vista Business
GLBasic SDK premium, Version: next update (beta)

Offline WPShadow

  • Prof. Inline
  • *****
  • Posts: 1313
    • View Profile
    • http://lostrevenant.blogspot.com
Re: Viewport
« Reply #2 on: July 26, 2010, 04:30:42 pm »
Da liegt also mein Fehler! Danke!

Dann rechne ich relativ zur Position!  =D
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 8.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://www.lostrevenant.net
alea iacta est