Redraw and resize in TW3CustomGameApplication?

SMS Version 2.1.2.3592

How to redraw or call the PaintView method when the application was resized in the browser (in TW3CustomGameApplication)?

I use the properties of GameView.Width and GameView.Height to determine the sizes of many things in my application. When the size of the application changes, I need to redraw or repaint

It does not look like there is a Resize event to override.

Questions

1.) How to block the resize event?

2.) How to repaint?

+4
source share
1 answer

TW3CustomGameApplication, , JavaScript.

, canvas :

GameView.Context.Handle.addEventListener('resize', @ResizeEvent);

ResizeEvent

procedure TYourClass.ResizeEvent(Event: JEvent);
begin
  // handle resizing
end;

:

Window.addEventListener('resize', @ResizeEvent);

, .

API- W3C , W3C.HTML5 W3C.DOM.

API - / W3C , :

, ( ).

RAD , TW3CustomGameApplication, , , , .

+4

Source: https://habr.com/ru/post/1622922/


All Articles