Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / [SOLVED] Zoon into X and Y

Author
Message
brunuu
5
Years of Service
User Offline
Joined: 4th Jun 2018
Location:
Posted: 19th Jul 2019 03:31
Is there any way I can zoom in on a particular coordinate on the screen?

The author of this post has marked a post as an answer.

Go to answer

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th Jul 2019 03:38
SetCameraLookAt ( cameraID, x, y, z, roll )
MoveCameraLocalZ ( cameraID, amount )

those commands should help
by default cameraID=1

not sure what your trying to do but you could have a loop
that moves until it reaches a particular z coordinate which might be getObjectZ(objectID)-5 for example
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
brunuu
5
Years of Service
User Offline
Joined: 4th Jun 2018
Location:
Posted: 19th Jul 2019 03:43
I forgot to say that it's 2D


the SetViewZoomMode command only allows center and top left
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 19th Jul 2019 18:39
you can set the camera position/offset and zoom in 2D with SetViewOffset( x, y ) and SetViewZoom( zoom )
as fubarpk said, if you don't want an instant zoom you just move / zoom in a loop until you reach your intended result.
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 19th Jul 2019 18:43
Whats wrong with moving to your location in 2D space and then zoom in centered ?
I wonder if the setup for AGK's Ortographic camera, changes something for 2D.
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 23rd Jul 2019 08:26
had no idea agk had a zoom function pretty sweet.
Signature removed for breach of size rules
Signature images may not be any larger than a total of 600x120 pixels in size.


markem
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location:
Posted: 27th Jul 2019 18:46
The following used to work. It might not do so now but it worked under version 0.8:

function getPixel(x,y)
render()
img = getimage(x,y,1,1)
ClearScreen()
mb = CreateMemblockFromImage(img)

c = GetMemblockInt( mb, 12 )

DeleteImage(img)
DeleteMemblock(mb)

endfunction c
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 27th Jul 2019 19:41 Edited at: 27th Jul 2019 19:42
This post has been marked by the post author as the answer.
Pinch Zoom https://forum.thegamecreators.com/thread/205033
https://www.instagram.com/qugurun/

Login to post a reply

Server time is: 2024-04-19 14:51:20
Your offset time is: 2024-04-19 14:51:20