Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
view.Viewport.Top doesn`t work
Print
Pages: [
1
]
Author
Topic: view.Viewport.Top doesn`t work (Read 1827 times)
0 Members and 1 Guest are viewing this topic.
R0M41K
Newbie
Posts: 4
view.Viewport.Top doesn`t work
«
on:
January 23, 2017, 04:31:18 pm »
Hello there.
Writing on SFML.NET. When i use the view.Viewport.Top or view.Viewport.Left, it's results in 0, although it should be -100 in my case. What's the problem? How can i get the position of my camera?
static
void
Main
(
)
{
RenderWindow window
=
new
RenderWindow
(
new
Window
.
VideoMode
(
500
,
300
)
,
"test"
)
;
View view
=
new
View
(
new
Vector2f
(
-
100
,
-
100
)
, window
.
GetView
(
)
.
Size
)
;
window
.
Closed
+=
(
o, a
)
=>
window
.
Close
(
)
;
CircleShape circle
=
new
CircleShape
(
20
)
;
while
(
window
.
IsOpen
(
)
)
{
Console
.
WriteLine
(
view
.
Viewport
.
Top
)
;
window
.
SetView
(
view
)
;
window
.
Draw
(
circle
)
;
window
.
DispatchEvents
(
)
;
window
.
Display
(
)
;
window
.
Clear
(
)
;
}
}
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11016
Re: view.Viewport.Top doesn`t work
«
Reply #1 on:
January 23, 2017, 04:55:38 pm »
Do you
understand
how the view works?
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
R0M41K
Newbie
Posts: 4
Re: view.Viewport.Top doesn`t work
«
Reply #2 on:
January 23, 2017, 05:09:39 pm »
Unfortunately, i bad in english. It will be very difficult to me to find a necessary information there. Would you tell that i am doing wrong, please?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: view.Viewport.Top doesn`t work
«
Reply #3 on:
January 23, 2017, 05:26:27 pm »
The view's area (what you set with the constructor) and its viewport (what you print) are two different things. I don't know how to explain that better than in the doc/tutorial/wiki
Logged
Laurent Gomila - SFML developer
R0M41K
Newbie
Posts: 4
Re: view.Viewport.Top doesn`t work
«
Reply #4 on:
January 23, 2017, 05:45:15 pm »
Got it. How can i get the position of this view's area? Does SFML have some methods for this?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: view.Viewport.Top doesn`t work
«
Reply #5 on:
January 23, 2017, 08:16:34 pm »
View.Center and View.Size.
Logged
Laurent Gomila - SFML developer
R0M41K
Newbie
Posts: 4
Re: view.Viewport.Top doesn`t work
«
Reply #6 on:
January 23, 2017, 08:18:12 pm »
Thanks
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
view.Viewport.Top doesn`t work
anything