Documentation
¶
Overview ¶
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
SFML - Simple and Fast Multimedia Library Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////
Index ¶
- Constants
- func Bool(b bool) C.sfBool
- func Debug(x interface{})
- func DebugN(x interface{})
- func DebugT(x interface{})
- func GetGlobalVolume() float32
- func IsKeyPressed(key KeyCode) bool
- func MouseGetPosition(win Window) (int, int)
- func MouseGetPositionAbsolute() (int, int)
- func SetDirection(orientation Vector3f)
- func SetGlobalVolume(volume float32)
- func SetMousePosition(x, y int, win Window)
- func SetMousePositionAbsolute(x, y int)
- func SetPosition(pos Vector3f)
- func TextureMaximumSize() uint
- type CEvent
- type CWindow
- type CWindowHandle
- type CircleShape
- func (self CircleShape) Copy() CircleShape
- func (self CircleShape) Destroy()
- func (self CircleShape) FillColor() Color
- func (self CircleShape) GetScale() (float32, float32)
- func (self CircleShape) GlobalBounds() FloatRect
- func (self CircleShape) InverseTransform() Transform
- func (self CircleShape) LocalBounds() FloatRect
- func (self CircleShape) Move(x, y float32)
- func (self CircleShape) Origin() (float32, float32)
- func (self CircleShape) OutlineColor() Color
- func (self CircleShape) OutlinkThickness() float32
- func (self CircleShape) Point(index uint) (float32, float32)
- func (self CircleShape) PointCount() int
- func (self CircleShape) Position() (float32, float32)
- func (self CircleShape) Radius() float32
- func (self CircleShape) Rotate(angle float32)
- func (self CircleShape) Rotation() float32
- func (self CircleShape) Scale(x, y float32)
- func (self CircleShape) SetFillColor(color Color)
- func (self CircleShape) SetOrigin(x, y float32)
- func (self CircleShape) SetOutlineColor(color Color)
- func (self CircleShape) SetOutlineThickness(thickness float32)
- func (self CircleShape) SetPointCount(count uint)
- func (self CircleShape) SetPosition(x, y float32)
- func (self CircleShape) SetRadius(radius float32)
- func (self CircleShape) SetRotation(angle float32)
- func (self CircleShape) SetScale(x, y float32)
- func (self CircleShape) SetTexture(tex Texture, resetRect bool)
- func (self CircleShape) SetTextureRect(rect IntRect)
- func (self CircleShape) Texture() Texture
- func (self CircleShape) TextureRect() IntRect
- func (self CircleShape) Transform() Transform
- type Clock
- type Color
- func (self Color) Add(color2 Color) Color
- func (self Color) Alpha() uint8
- func (self Color) Blue() uint8
- func (self Color) Components() (uint8, uint8, uint8, uint8)
- func (self Color) Green() uint8
- func (self Color) Modulate(color2 Color) Color
- func (self Color) Red() uint8
- func (self Color) String() string
- type Context
- type ContextSettings
- type ConvexShape
- func (self ConvexShape) Copy() ConvexShape
- func (self ConvexShape) Destroy()
- func (self ConvexShape) GetFillColor() Color
- func (self ConvexShape) GetGlobalBounds() FloatRect
- func (self ConvexShape) GetInverseTransform() Transform
- func (self ConvexShape) GetLocalBounds() FloatRect
- func (self ConvexShape) GetOrigin() (x, y float32)
- func (self ConvexShape) GetOutlineColor() Color
- func (self ConvexShape) GetOutlineThickness() float32
- func (self ConvexShape) GetPoint(index uint) (x, y float32)
- func (self ConvexShape) GetPointCount() uint
- func (self ConvexShape) GetPosition() (x, y float32)
- func (self ConvexShape) GetRotation() float32
- func (self ConvexShape) GetScale() (x, y float32)
- func (self ConvexShape) GetTexture() Texture
- func (self ConvexShape) GetTextureRect() IntRect
- func (self ConvexShape) GetTransform() Transform
- func (self ConvexShape) Move(x, y float32)
- func (self ConvexShape) Rotate(angle float32)
- func (self ConvexShape) Scale(x, y float32)
- func (self ConvexShape) SetFillColor(color Color)
- func (self ConvexShape) SetOutlineColor(color Color)
- func (self ConvexShape) SetOutlineThickness(thickness float32)
- func (self ConvexShape) SetPoint(index uint, x, y float32)
- func (self ConvexShape) SetPointCount(count uint)
- func (self ConvexShape) SetScale(x, y float32)
- func (self ConvexShape) SetTexture(txt Texture, resetRect bool)
- func (self ConvexShape) Setorigin(x, y float32)
- func (self ConvexShape) Setposition(position Vector2f)
- func (self ConvexShape) Setrotation(angle float32)
- func (self ConvexShape) Settexturerect(rect IntRect)
- type Event
- func (self Event) ToJoystickButtonEvent() JoystickButtonEvent
- func (self Event) ToJoystickConnectEvent() JoystickConnectEvent
- func (self Event) ToJoystickMoveEvent() JoystickMoveEvent
- func (self Event) ToKeyEvent() KeyEvent
- func (self Event) ToMouseButtonEvent() MouseButtonEvent
- func (self Event) ToMouseMoveEvent() MouseMoveEvent
- func (self Event) ToMouseWheelEvent() MouseWheelEvent
- func (self Event) ToSizeEvent() SizeEvent
- func (self Event) ToTextEvent() TextEvent
- type EventType
- type FloatRect
- func (self FloatRect) Contains(x, y float32) bool
- func (self FloatRect) Height() float32
- func (self FloatRect) Intersects(rect FloatRect) (*FloatRect, bool)
- func (self FloatRect) Left() float32
- func (self FloatRect) Show() string
- func (self FloatRect) Top() float32
- func (self FloatRect) Width() float32
- type Font
- func (self Font) Copy() Font
- func (self Font) Destroy()
- func (self Font) Glyph(codePoint, characterSize uint32, bold bool) Glyph
- func (self Font) Kerning(first, second uint32, characterSize uint) int
- func (self Font) LineSpacing(characterSize int) int
- func (self Font) Texture(characterSize uint) Texture
- type Glyph
- type Image
- func (self Image) Copy() Image
- func (self Image) CopyImage(source Image, destX, destY int, sourceRect IntRect, applyAlpha bool)
- func (self Image) Destroy()
- func (self Image) FlipHorizontally()
- func (self Image) FlipVertically()
- func (self Image) Pixel(x, y uint) Color
- func (self Image) Savetofile(filename string) bool
- func (self Image) SetPixel(x, y uint, color Color)
- func (self Image) Size() (uint, uint)
- type IntRect
- type Joystick
- type JoystickAxis
- type JoystickButtonEvent
- type JoystickConnectEvent
- type JoystickMoveEvent
- type KeyCode
- type KeyEvent
- type MouseButton
- type MouseButtonEvent
- type MouseMoveEvent
- type MouseWheelEvent
- type Music
- func (self Music) Destroy()
- func (self Music) GetChannelCount() uint
- func (self Music) GetDuration() Time
- func (self Music) GetLoop() bool
- func (self Music) GetPitch() float32
- func (self Music) GetPlayingOffset() Time
- func (self Music) GetPosition() Vector3f
- func (self Music) GetSampleRate() int
- func (self Music) GetStatus() SoundStatus
- func (self Music) GetVolume() float32
- func (self Music) Getattenuation() float32
- func (self Music) Getmindistance() float32
- func (self Music) IsRelativeToListener() bool
- func (self Music) Pause()
- func (self Music) Play()
- func (self Music) SetAttenuation(attenuation float32)
- func (self Music) SetLoop(loop bool)
- func (self Music) SetMinDistance(distance float32)
- func (self Music) SetPitch(pitch float32)
- func (self Music) SetPlayingOffset(time Time)
- func (self Music) SetPosition(position Vector3f)
- func (self Music) SetRelativeToListener(relative bool)
- func (self Music) SetVolume(volume float32)
- func (self Music) Stop()
- type NullEvent
- type PrimitiveType
- type RectangleShape
- func (self RectangleShape) Copy() RectangleShape
- func (self RectangleShape) Destroy()
- func (self RectangleShape) FillColor() Color
- func (self RectangleShape) GetScale() (float32, float32)
- func (self RectangleShape) GlobalBounds() FloatRect
- func (self RectangleShape) InverseTransform() Transform
- func (self RectangleShape) LocalBounds() FloatRect
- func (self RectangleShape) Move(x, y float32)
- func (self RectangleShape) Origin() (float32, float32)
- func (self RectangleShape) OutlineColor() Color
- func (self RectangleShape) OutlinkThickness() float32
- func (self RectangleShape) Point(index uint) (float32, float32)
- func (self RectangleShape) PointCount() int
- func (self RectangleShape) Position() (float32, float32)
- func (self RectangleShape) Rotate(angle float32)
- func (self RectangleShape) Rotation() float32
- func (self RectangleShape) Scale(x, y float32)
- func (self RectangleShape) SetFillColor(color Color)
- func (self RectangleShape) SetOrigin(x, y float32)
- func (self RectangleShape) SetOutlineColor(color Color)
- func (self RectangleShape) SetOutlineThickness(thickness float32)
- func (self RectangleShape) SetPosition(x, y float32)
- func (self RectangleShape) SetRotation(angle float32)
- func (self RectangleShape) SetScale(x, y float32)
- func (self RectangleShape) SetSize(x, y float32)
- func (self RectangleShape) SetTexture(tex Texture, resetRect bool)
- func (self RectangleShape) SetTextureRect(rect IntRect)
- func (self RectangleShape) Size() (float32, float32)
- func (self RectangleShape) Texture() Texture
- func (self RectangleShape) TextureRect() IntRect
- func (self RectangleShape) Transform() Transform
- type RenderTexture
- func (self RenderTexture) Clear(color Color)
- func (self RenderTexture) Destroy()
- func (self RenderTexture) Display()
- func (self RenderTexture) DrawCircleShapeDefault(obj CircleShape)
- func (self RenderTexture) DrawRectangleShapeDefault(obj RectangleShape)
- func (self RenderTexture) DrawSpriteDefault(obj Sprite)
- func (self RenderTexture) DrawTextDefault(obj Text)
- func (self RenderTexture) IsSmooth() bool
- func (self RenderTexture) PopGLStates()
- func (self RenderTexture) PushGLStates()
- func (self RenderTexture) ResetGLStates()
- func (self RenderTexture) SetActive(active bool) bool
- func (self RenderTexture) SetSmooth(smooth bool)
- func (self RenderTexture) Size() (uint, uint)
- func (self RenderTexture) Texture() Texture
- type RenderWindow
- func (self RenderWindow) Capture() Image
- func (self RenderWindow) Clear(color Color)
- func (self RenderWindow) Close()
- func (self RenderWindow) Destroy()
- func (self RenderWindow) Display()
- func (self RenderWindow) Drain()
- func (self RenderWindow) DrawCircleShapeDefault(obj CircleShape)
- func (self RenderWindow) DrawRectangleShapeDefault(obj RectangleShape)
- func (self RenderWindow) DrawSpriteDefault(obj Sprite)
- func (self RenderWindow) DrawTextDefault(obj Text)
- func (self RenderWindow) GetSize() (x, y uint)
- func (self RenderWindow) IsOpen() bool
- func (self RenderWindow) PollEvent() (interface{}, bool)
- func (self RenderWindow) PopGLStates()
- func (self RenderWindow) Position() (int, int)
- func (self RenderWindow) PushGLStates()
- func (self RenderWindow) ResetGLStates()
- func (self RenderWindow) SetActive(active bool) bool
- func (self RenderWindow) SetFramerateLimit(limit uint)
- func (self RenderWindow) SetJoystickThreshold(threshold float32)
- func (self RenderWindow) SetKeyRepeatEnabled(enabled bool)
- func (self RenderWindow) SetMouseCursorVisible(show bool)
- func (self RenderWindow) SetPosition(x, y int)
- func (self RenderWindow) SetSize(x, y uint)
- func (self RenderWindow) SetTitle(title string)
- func (self RenderWindow) SetVerticalSyncEnabled(enabled bool)
- func (self RenderWindow) SetVisible(visible bool)
- func (self RenderWindow) Settings() ContextSettings
- func (self RenderWindow) ToWindow() Window
- func (self RenderWindow) WaitEvent(event Event) bool
- type Shader
- func (self Shader) Bind()
- func (self Shader) Destroy()
- func (self Shader) IsAvailable() bool
- func (self Shader) SetColorParameter(name string, color Color)
- func (self Shader) SetCurrentTextureParameter(name string)
- func (self Shader) SetFloat2Parameter(name string, x, y float32)
- func (self Shader) SetFloat3Parameter(name string, x, y, z float32)
- func (self Shader) SetFloatParameter(name string, x float32)
- func (self Shader) SetTextureParameter(name string, texture Texture)
- func (self Shader) SetTransformParameter(name string, transform Transform)
- func (self Shader) SetVector2Parameter(name string, x, y float32)
- func (self Shader) SetVector3parameter(name string, vector Vector3f)
- func (self Shader) Setfloat4parameter(name string, x, y, z, w float32)
- type SizeEvent
- type Sound
- func (self Sound) Copy() Sound
- func (self Sound) Destroy()
- func (self Sound) GetAttenuation() float32
- func (self Sound) GetLoop() bool
- func (self Sound) GetPlayingOffset() Time
- func (self Sound) GetVolume() float32
- func (self Sound) Getmindistance() float32
- func (self Sound) Getpitch() float32
- func (self Sound) Getposition() (v Vector3f)
- func (self Sound) Getstatus() SoundStatus
- func (self Sound) IsRelativeToListener() bool
- func (self Sound) NewSound() Sound
- func (self Sound) Pause()
- func (self Sound) Play()
- func (self Sound) SetLoop(loop bool)
- func (self Sound) SetMinDistance(distance float32)
- func (self Sound) SetPitch(pitch float32)
- func (self Sound) SetPlayingOffset(timeOffset Time)
- func (self Sound) SetPosition(v Vector3f)
- func (self Sound) SetVolume(volume float32)
- func (self Sound) Setattenuation(attenuation float32)
- func (self Sound) Stop()
- type SoundBuffer
- func (self SoundBuffer) Copy() SoundBuffer
- func (self SoundBuffer) Destroy()
- func (self SoundBuffer) GetChannelCount() uint
- func (self SoundBuffer) GetSampleCount() C.size_t
- func (self SoundBuffer) GetSampleRate() uint
- func (self SoundBuffer) Getduration() Time
- func (self SoundBuffer) SaveToFile(filename string) bool
- type SoundBufferRecorder
- type SoundStatus
- type Sprite
- func (self Sprite) Color() Color
- func (self Sprite) Copy() Sprite
- func (self Sprite) Destroy()
- func (self Sprite) GetScale() (float32, float32)
- func (self Sprite) GlobalBounds() FloatRect
- func (self Sprite) InverseTransform() Transform
- func (self Sprite) LocalBounds() FloatRect
- func (self Sprite) Move(x, y float32)
- func (self Sprite) Origin() (float32, float32)
- func (self Sprite) Position() (float32, float32)
- func (self Sprite) Rotate(angle float32)
- func (self Sprite) Rotation() float32
- func (self Sprite) Scale(x, y float32)
- func (self Sprite) SetColor(color Color)
- func (self Sprite) SetOrigin(x, y float32)
- func (self Sprite) SetPosition(x, y float32)
- func (self Sprite) SetRotation(angle float32)
- func (self Sprite) SetScale(x, y float32)
- func (self Sprite) SetTexture(tex Texture, resetRect bool)
- func (self Sprite) SetTextureRect(rect IntRect)
- func (self Sprite) Texture() Texture
- func (self Sprite) TextureRect() IntRect
- func (self Sprite) Transform() Transform
- type Text
- func (self Text) CharacterSize() uint
- func (self Text) Color() Color
- func (self Text) Copy() Text
- func (self Text) Destroy()
- func (self Text) FindCharacterPos(index uint) Vector2f
- func (self Text) Font() Font
- func (self Text) GetScale() (x, y float32)
- func (self Text) GlobalBounds() FloatRect
- func (self Text) InverseTransform() Transform
- func (self Text) LocalBounds() FloatRect
- func (self Text) Move(x, y float32)
- func (self Text) Origin() (x, y float32)
- func (self Text) Position(x, y float32) (float32, float32)
- func (self Text) Rotate(angle float32)
- func (self Text) Rotation() float32
- func (self Text) Scale(x, y float32)
- func (self Text) SetCharacterSize(size int)
- func (self Text) SetColor(color Color)
- func (self Text) SetFont(font Font)
- func (self Text) SetOrigin(x, y float32)
- func (self Text) SetPosition(x, y float32)
- func (self Text) SetRotation(angle float32)
- func (self Text) SetScale(x, y float32)
- func (self Text) SetString(s string)
- func (self Text) SetStyle(style uint32)
- func (self Text) SetUnicodeString(s string)
- func (self Text) String() string
- func (self Text) Style() uint
- func (self Text) Transform() Transform
- func (self Text) UnicodeString() string
- type TextEvent
- type Texture
- func (self Texture) Bind()
- func (self Texture) Copy() Texture
- func (self Texture) CopyToImage() Image
- func (self Texture) Destroy()
- func (self Texture) IsRepeated() bool
- func (self Texture) IsSmooth() bool
- func (self Texture) SetRepeated(repeated bool)
- func (self Texture) SetSmooth(smooth bool)
- func (self Texture) Size() (x, y uint)
- func (self Texture) UpdateFromImage(img Image, x, y uint)
- func (self Texture) UpdateFromPixels(pixels []uint8, w, h, x, y int)
- func (self Texture) UpdateFromRenderWindow(win RenderWindow, x, y uint)
- func (self Texture) UpdateFromWindow(w Window, x, y uint)
- type Time
- type Transform
- func (self Transform) Combine(other Transform)
- func (self Transform) GetInverse() Transform
- func (self Transform) GetMatrix(matrix [16]float32)
- func (self Transform) Rotate(angle float32)
- func (self Transform) RotateWithCenter(angle, centerX, centerY float32)
- func (self Transform) Scale(scaleX, scaleY float32)
- func (self Transform) ScaleWithCenter(scaleX, scaleY, centerX, centerY float32)
- func (self Transform) TransformPoint(x, y float32) (float32, float32)
- func (self Transform) TransformRect(rect FloatRect) FloatRect
- func (self Transform) Translate(x, y float32)
- type Vector2f
- type Vector2i
- type Vector2u
- type Vector3f
- type Vertex
- type VertexArray
- func (self VertexArray) Append(vertex Vertex)
- func (self VertexArray) Clear()
- func (self VertexArray) Copy() VertexArray
- func (self VertexArray) Destroy()
- func (self VertexArray) GetVertex(index uint) Vertex
- func (self VertexArray) GetVertexCount() uint
- func (self VertexArray) Getbounds() FloatRect
- func (self VertexArray) Getprimitivetype() PrimitiveType
- func (self VertexArray) Resize(vertexCount uint)
- func (self VertexArray) SetPrimitiveType(ptype PrimitiveType)
- type VideoMode
- type View
- func (self View) Copy() View
- func (self View) Destroy()
- func (self View) GetCenter() (x, y float32)
- func (self View) GetRotation() float32
- func (self View) GetSize() (x, y float32)
- func (self View) GetViewport() FloatRect
- func (self View) Move(x, y float32)
- func (self View) NewView() View
- func (self View) NewViewFromRect(r FloatRect) View
- func (self View) Reset(rectangle FloatRect)
- func (self View) Rotate(angle float32)
- func (self View) SetCenter(x, y float32)
- func (self View) SetRotation(angle float32)
- func (self View) SetSize(x, y float32)
- func (self View) SetViewport(viewport FloatRect)
- func (self View) Zoom(factor float32)
- type Window
- func (self Window) Close()
- func (self Window) Destroy()
- func (self Window) Display()
- func (self Window) GetSize() (x, y uint)
- func (self Window) IsOpen() bool
- func (self Window) PollEvent() (interface{}, bool)
- func (self Window) Position() (x, y int)
- func (self Window) SetActive(active bool) bool
- func (self Window) SetFramerateLimit(limit uint)
- func (self Window) SetIcon(width, height int, pixels []uint8)
- func (self Window) SetJoystickThreshold(threshold float32)
- func (self Window) SetKeyRepeatEnabled(enabled bool)
- func (self Window) SetMouseCursorVisible(visible bool)
- func (self Window) SetPosition(x, y int)
- func (self Window) SetSize(x, y uint)
- func (self Window) SetTitle(title string)
- func (self Window) SetVerticalSyncEnabled(enabled bool)
- func (self Window) SetVisible(visible bool)
- func (self Window) Settings() ContextSettings
- type WindowHandle
Constants ¶
const ( MouseLeft = iota // The left mouse button MouseRight // The right mouse button MouseMiddle // The middle (wheel) mouse button MouseXButton1 // The first extra mouse button MouseXButton2 // The second extra mouse button MouseButtonCount // Keep last -- the total number of mouse buttons )
Mouse buttons
const ( // No border / title bar (this flag and all others are mutually exclusive) StyleNone = 0 // Title bar + fixed border StyleTitlebar = 1 << 0 // Titlebar + resizable border + maximize button StyleResize = 1 << 1 // Titlebar + close button StyleClose = 1 << 2 // Fullscreen mode (this flag and all others are mutually exclusive) StyleFullscreen = 1 << 3 // Default window style StyleDefaultStyle = StyleTitlebar | StyleResize | StyleClose )
Enumeration of window creation styles
Variables ¶
This section is empty.
Functions ¶
func GetGlobalVolume ¶
func GetGlobalVolume() float32
\brief Get the current value of the global volume \return Current global volume, in the range [0, 100] float sfListener_getGlobalVolume(void);
func IsKeyPressed ¶
Check if a key is pressed key Key to check return true if the key is pressed, false otherwise sfBool sfKeyboard_isKeyPressed(sfKeyCode key);
func MouseGetPosition ¶
Get the current position of the mouse This function returns the current position of the mouse cursor relative to the given window.
func MouseGetPositionAbsolute ¶
Get the current position of the mouse This function returns the current position of the mouse cursor relative to the desktop
func SetDirection ¶
func SetDirection(orientation Vector3f)
\brief Set the orientation of the listener in the scene The orientation defines the 3D axes of the listener (left, up, front) in the scene. The orientation vector doesn't have to be normalized. The default listener's orientation is (0, 0, -1). \param position New direction of the listener sfListener_setDirection(sfVector3f orientation);
func SetGlobalVolume ¶
func SetGlobalVolume(volume float32)
\brief Change the global volume of all the sounds and musics The volume is a number between 0 and 100; it is combined with the individual volume of each sound / music. The default value for the volume is 100 (maximum). \param volume New global volume, in the range [0, 100] sfListener_setGlobalVolume(float volume);
func SetMousePosition ¶
Set the current position of the mouse This function sets the current position of the mouse cursor relative to the given window.
func SetMousePositionAbsolute ¶
func SetMousePositionAbsolute(x, y int)
Set the current position of the mouse. This function sets the current position of the mouse cursor relative to the desktop.
func SetPosition ¶
func SetPosition(pos Vector3f)
\brief Set the position of the listener in the scene The default listener's position is (0, 0, 0). \param position New position of the listener sfListener_setPosition(sfVector3f position);
func TextureMaximumSize ¶
func TextureMaximumSize() uint
\brief Get the maximum texture size allowed \return Maximum size allowed for textures, in pixels unsigned int sfTexture_getMaximumSize();
Types ¶
type CWindowHandle ¶
type CWindowHandle C.sfWindowHandle
type CircleShape ¶
type CircleShape struct {
Cref *C.sfCircleShape
}
func NewCircle ¶
func NewCircle() CircleShape
Create a new circle shape \return A new sfCircleShape object, or NULL if it failed sfCircleShape* sfCircleShape_create(void);
func (CircleShape) Copy ¶
func (self CircleShape) Copy() CircleShape
Copy an existing circle shape \param shape Shape to copy \return Copied object sfCircleShape* sfCircleShape_copy(sfCircleShape* shape);
func (CircleShape) Destroy ¶
func (self CircleShape) Destroy()
Destroy an existing circle Shape \param Shape Shape to delete void sfCircleShape_destroy(sfCircleShape* shape);
func (CircleShape) FillColor ¶
func (self CircleShape) FillColor() Color
Get the fill color of a circle shape \param shape Shape object \return Fill color of the shape sfColor sfCircleShape_getFillColor(const sfCircleShape* shape);
func (CircleShape) GetScale ¶
func (self CircleShape) GetScale() (float32, float32)
Get the current scale of a circle shape \param shape Shape object \return Current scale factors sfVector2f sfCircleShape_GetScale(const sfCircleShape* shape);
func (CircleShape) GlobalBounds ¶
func (self CircleShape) GlobalBounds() FloatRect
Get the global bounding rectangle of a circle shape The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system. \param shape Shape object \return Global bounding rectangle of the entity sfFloatRect sfCircleShape_getGlobalBounds(const sfCircleShape* shape);
func (CircleShape) InverseTransform ¶
func (self CircleShape) InverseTransform() Transform
Get the inverse of the combined transform of a circle shape \param shape Shape object \return Inverse of the combined transformations applied to the object const sfTransform* sfCircleShape_getInverseTransform(const sfCircleShape* shape);
func (CircleShape) LocalBounds ¶
func (self CircleShape) LocalBounds() FloatRect
Get the local bounding rectangle of a circle shape The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system. \param shape Shape object \return Local bounding rectangle of the entity sfFloatRect sfCircleShape_getLocalBounds(const sfCircleShape* shape);
func (CircleShape) Move ¶
func (self CircleShape) Move(x, y float32)
Move a circle shape by a given offset This function adds to the current position of the object, unlike sfCircleShape_setPosition which overwrites it. \param shape Shape object \param offset Offset void sfCircleShape_move(sfCircleShape* shape, sfVector2f offset);
func (CircleShape) Origin ¶
func (self CircleShape) Origin() (float32, float32)
Get the local origin of a circle shape \param shape Shape object \return Current origin sfVector2f sfCircleShape_GetOrigin(const sfCircleShape* shape);
func (CircleShape) OutlineColor ¶
func (self CircleShape) OutlineColor() Color
Get the outline color of a circle shape \param shape Shape object \return Outline color of the shape sfColor sfCircleShape_getOutlineColor(const sfCircleShape* shape);
func (CircleShape) OutlinkThickness ¶
func (self CircleShape) OutlinkThickness() float32
Get the outline thickness of a circle shape \param shape Shape object \return Outline thickness of the shape float sfCircleShape_getOutlineThickness(const sfCircleShape* shape);
func (CircleShape) Point ¶
func (self CircleShape) Point(index uint) (float32, float32)
Get a point of a circle shape The result is undefined if \a index is out of the valid range. \param shape Shape object \param index Index of the point to get, in range [0 .. getPointCount() - 1] \return Index-th point of the shape sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, unsigned int index);
func (CircleShape) PointCount ¶
func (self CircleShape) PointCount() int
Get the total number of points of a circle shape \param shape Shape object \return Number of points of the shape unsigned int sfCircleShape_getPointCount(const sfCircleShape* shape);
func (CircleShape) Position ¶
func (self CircleShape) Position() (float32, float32)
Get the position of a circle shape \param shape Shape object \return Current position sfVector2f sfCircleShape_getPosition(const sfCircleShape* shape);
func (CircleShape) Radius ¶
func (self CircleShape) Radius() float32
Get the radius of a circle \param shape Shape object \return Radius of the circle float sfCircleShape_getRadius(const sfCircleShape* shape);
func (CircleShape) Rotate ¶
func (self CircleShape) Rotate(angle float32)
Rotate a circle shape This function adds to the current rotation of the object, unlike sfCircleShape_setRotation which overwrites it. \param shape Shape object \param angle Angle of rotation, in degrees void sfCircleShape_rotate(sfCircleShape* shape, float angle);
func (CircleShape) Rotation ¶
func (self CircleShape) Rotation() float32
Get the orientation of a circle shape The rotation is always in the range [0, 360]. \param shape Shape object \return Current rotation, in degrees float sfCircleShape_getRotation(const sfCircleShape* shape);
func (CircleShape) Scale ¶
func (self CircleShape) Scale(x, y float32)
Scale a circle shape This function multiplies the current scale of the object, unlike sfCircleShape_setScale which overwrites it. \param shape Shape object \param factors Scale factors void sfCircleShape_scale(sfCircleShape* shape, sfVector2f factors);
func (CircleShape) SetFillColor ¶
func (self CircleShape) SetFillColor(color Color)
Set the fill color of a circle shape This color is modulated (multiplied) with the shape's texture if any. It can be used to colorize the shape, or change its global opacity. You can use sfTransparent to make the inside of the shape transparent, and have the outline alone. By default, the shape's fill color is opaque white. \param shape Shape object \param color New color of the shape void sfCircleShape_setFillColor(sfCircleShape* shape, sfColor color);
func (CircleShape) SetOrigin ¶
func (self CircleShape) SetOrigin(x, y float32)
Set the local origin of a circle shape The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a circle Shape object is (0, 0). \param shape Shape object \param origin New origin void sfCircleShape_setOrigin(sfCircleShape* shape, sfVector2f origin);
func (CircleShape) SetOutlineColor ¶
func (self CircleShape) SetOutlineColor(color Color)
Set the outline color of a circle shape You can use sfTransparent to disable the outline. By default, the shape's outline color is opaque white. \param shape Shape object \param color New outline color of the shape void sfCircleShape_setOutlineColor(sfCircleShape* shape, sfColor color);
func (CircleShape) SetOutlineThickness ¶
func (self CircleShape) SetOutlineThickness(thickness float32)
Set the thickness of a circle shape's outline This number cannot be negative. Using zero disables the outline. By default, the outline thickness is 0. \param shape Shape object \param thickness New outline thickness void sfCircleShape_setOutlineThickness(sfCircleShape* shape, float thickness);
func (CircleShape) SetPointCount ¶
func (self CircleShape) SetPointCount(count uint)
Set the number of points of a circle \param shape Shape object \param count New number of points of the circle void sfCircleShape_setPointCount(sfCircleShape* shape, unsigned int count);
func (CircleShape) SetPosition ¶
func (self CircleShape) SetPosition(x, y float32)
Set the position of a circle shape This function completely overwrites the previous position. See sfCircleShape_move to apply an offset based on the previous position instead. The default position of a circle Shape object is (0, 0). \param shape Shape object \param position New position void sfCircleShape_setPosition(sfCircleShape* shape, sfVector2f position);
func (CircleShape) SetRadius ¶
func (self CircleShape) SetRadius(radius float32)
Set the radius of a circle \param shape Shape object \param radius New radius of the circle void sfCircleShape_setRadius(sfCircleShape* shape, float radius);
func (CircleShape) SetRotation ¶
func (self CircleShape) SetRotation(angle float32)
Set the orientation of a circle shape This function completely overwrites the previous rotation. See sfCircleShape_rotate to add an angle based on the previous rotation instead. The default rotation of a circle Shape object is 0. \param shape Shape object \param angle New rotation, in degrees void sfCircleShape_setRotation(sfCircleShape* shape, float angle);
func (CircleShape) SetScale ¶
func (self CircleShape) SetScale(x, y float32)
Set the scale factors of a circle shape This function completely overwrites the previous scale. See sfCircleShape_scale to add a factor based on the previous scale instead. The default scale of a circle Shape object is (1, 1). \param shape Shape object \param scale New scale factors void sfCircleShape_setScale(sfCircleShape* shape, sfVector2f scale);
func (CircleShape) SetTexture ¶
func (self CircleShape) SetTexture(tex Texture, resetRect bool)
Change the source texture of a circle shape The \a texture argument refers to a texture that must exist as long as the shape uses it. Indeed, the shape doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the shape tries to use it, the behaviour is undefined. \a texture can be NULL to disable texturing. If \a resetRect is true, the TextureRect property of the shape is automatically adjusted to the size of the new texture. If it is false, the texture rect is left unchanged. \param shape Shape object \param texture New texture \param resetRect Should the texture rect be reset to the size of the new texture? void sfCircleShape_setTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect);
func (CircleShape) SetTextureRect ¶
func (self CircleShape) SetTextureRect(rect IntRect)
Set the sub-rectangle of the texture that a circle shape will display The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture. \param shape Shape object \param rect Rectangle defining the region of the texture to display void sfCircleShape_setTextureRect(sfCircleShape* shape, sfIntRect rect);
func (CircleShape) Texture ¶
func (self CircleShape) Texture() Texture
Get the source texture of a circle shape If the shape has no source texture, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the texture when you retrieve it with this function. \param shape Shape object \return Pointer to the shape's texture const sfTexture* sfCircleShape_getTexture(const sfCircleShape* shape);
func (CircleShape) TextureRect ¶
func (self CircleShape) TextureRect() IntRect
Get the sub-rectangle of the texture displayed by a circle shape \param shape Shape object \return Texture rectangle of the shape sfIntRect sfCircleShape_getTextureRect(const sfCircleShape* shape);
func (CircleShape) Transform ¶
func (self CircleShape) Transform() Transform
Get the combined transform of a circle shape \param shape Shape object \return Transform combining the position/rotation/scale/origin of the object const sfTransform* sfCircleShape_getTransform(const sfCircleShape* shape);
type Clock ¶
func (Clock) GetElapsedTime ¶
type Color ¶
Utility class for manpulating RGBA colors
func FromRGB ¶
Construct a color from its 3 RGB components
\param red Red component (0 .. 255) \param green Green component (0 .. 255) \param blue Blue component (0 .. 255)
\return sfColor constructed from the components sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 blue);
func FromRGBA ¶
Construct a color from its 4 RGBA components
\param red Red component (0 .. 255) \param green Green component (0 .. 255) \param blue Blue component (0 .. 255) \param alpha Alpha component (0 .. 255)
\return sfColor constructed from the components
sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha);
func (Color) Add ¶
Add two colors
\param color2 Second color
\return Component-wise saturated addition of the two colors
sfColor sfColor_add(sfColor color1, sfColor color2);
func (Color) Components ¶
Return the components of a color
type Context ¶
func NewContext ¶
Create a new context This function activates the new context. \return New sfContext object sfContext* sfContext_create(void);
type ContextSettings ¶
type ContextSettings struct {
Cref *C.sfContextSettings
}
Structure defining the window's creation settings
func NewContextSettings ¶
func NewContextSettings(depthbits, stencilbits, antialiasinglevel, majVersion, minVersion uint) ContextSettings
func (ContextSettings) AntialiasingLevel ¶
func (self ContextSettings) AntialiasingLevel() uint
func (ContextSettings) DepthBits ¶
func (self ContextSettings) DepthBits() uint
func (ContextSettings) MajorVersion ¶
func (self ContextSettings) MajorVersion() uint
func (ContextSettings) MinorVersion ¶
func (self ContextSettings) MinorVersion() uint
func (ContextSettings) Nil ¶
func (self ContextSettings) Nil() bool
func (ContextSettings) StencilBits ¶
func (self ContextSettings) StencilBits() uint
type ConvexShape ¶
type ConvexShape struct {
Cref *C.sfConvexShape
}
func NewConvexShape ¶
func NewConvexShape() ConvexShape
\brief Create a new convex shape \return A new sfConvexShape object, or NULL if it failed sfConvexShape* sfConvexShape_create(void);
func (ConvexShape) Copy ¶
func (self ConvexShape) Copy() ConvexShape
\brief Copy an existing convex shape \param shape Shape to copy \return Copied object sfConvexShape* sfConvexShape_copy(sfConvexShape* shape);
func (ConvexShape) Destroy ¶
func (self ConvexShape) Destroy()
\brief Destroy an existing convex Shape \param Shape Shape to delete void sfConvexShape_destroy(sfConvexShape* shape);
func (ConvexShape) GetFillColor ¶
func (self ConvexShape) GetFillColor() Color
\brief Get the fill color of a convex shape \param shape Shape object \return Fill color of the shape sfColor sfConvexShape_getFillColor(const sfConvexShape* shape);
func (ConvexShape) GetGlobalBounds ¶
func (self ConvexShape) GetGlobalBounds() FloatRect
\brief Get the global bounding rectangle of a convex shape The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system. \param shape Shape object \return Global bounding rectangle of the entity sfFloatRect sfConvexShape_getGlobalBounds(const sfConvexShape* shape);
func (ConvexShape) GetInverseTransform ¶
func (self ConvexShape) GetInverseTransform() Transform
\brief Get the inverse of the combined transform of a convex shape \param shape shape object \return Inverse of the combined transformations applied to the object const sfTransform* sfConvexShape_getInverseTransform(const sfConvexShape* shape);
func (ConvexShape) GetLocalBounds ¶
func (self ConvexShape) GetLocalBounds() FloatRect
\brief Get the local bounding rectangle of a convex shape The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system. \param shape Shape object \return Local bounding rectangle of the entity sfFloatRect sfConvexShape_getLocalBounds(const sfConvexShape* shape);
func (ConvexShape) GetOrigin ¶
func (self ConvexShape) GetOrigin() (x, y float32)
\brief Get the local origin of a convex shape \param shape Shape object \return Current origin sfVector2f sfConvexShape_getOrigin(const sfConvexShape* shape);
func (ConvexShape) GetOutlineColor ¶
func (self ConvexShape) GetOutlineColor() Color
\brief Get the outline color of a convex shape \param shape Shape object \return Outline color of the shape sfColor sfConvexShape_getOutlineColor(const sfConvexShape* shape);
func (ConvexShape) GetOutlineThickness ¶
func (self ConvexShape) GetOutlineThickness() float32
\brief Get the outline thickness of a convex shape \param shape Shape object \return Outline thickness of the shape float sfConvexShape_getOutlineThickness(const sfConvexShape* shape);
func (ConvexShape) GetPoint ¶
func (self ConvexShape) GetPoint(index uint) (x, y float32)
\brief Get a point of a convex shape The result is undefined if \a index is out of the valid range. \param shape Shape object \param index Index of the point to get, in range [0 .. getPointCount() - 1] \return Index-th point of the shape sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index);
func (ConvexShape) GetPointCount ¶
func (self ConvexShape) GetPointCount() uint
\brief Get the total number of points of a convex shape \param shape Shape object \return Number of points of the shape unsigned int sfConvexShape_getPointCount(const sfConvexShape* shape);
func (ConvexShape) GetPosition ¶
func (self ConvexShape) GetPosition() (x, y float32)
\brief Get the position of a convex shape \param shape Shape object \return Current position sfVector2f sfConvexShape_getPosition(const sfConvexShape* shape);
func (ConvexShape) GetRotation ¶
func (self ConvexShape) GetRotation() float32
\brief Get the orientation of a convex shape The rotation is always in the range [0, 360]. \param shape Shape object \return Current rotation, in degrees float sfConvexShape_getRotation(const sfConvexShape* shape);
func (ConvexShape) GetScale ¶
func (self ConvexShape) GetScale() (x, y float32)
\brief Get the current scale of a convex shape \param shape Shape object \return Current scale factors sfVector2f sfConvexShape_getScale(const sfConvexShape* shape);
func (ConvexShape) GetTexture ¶
func (self ConvexShape) GetTexture() Texture
\brief Get the source texture of a convex shape If the shape has no source texture, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the texture when you retrieve it with this function. \param shape Shape object \return Pointer to the shape's texture const sfTexture* sfConvexShape_getTexture(const sfConvexShape* shape);
func (ConvexShape) GetTextureRect ¶
func (self ConvexShape) GetTextureRect() IntRect
\brief Get the sub-rectangle of the texture displayed by a convex shape \param shape Shape object \return Texture rectangle of the shape sfIntRect sfConvexShape_getTextureRect(const sfConvexShape* shape);
func (ConvexShape) GetTransform ¶
func (self ConvexShape) GetTransform() Transform
\brief Get the combined transform of a convex shape \param shape shape object \return Transform combining the position/rotation/scale/origin of the object const sfTransform* sfConvexShape_getTransform(const sfConvexShape* shape);
func (ConvexShape) Move ¶
func (self ConvexShape) Move(x, y float32)
\brief Move a convex shape by a given offset This function adds to the current position of the object, unlike sfConvexShape_setPosition which overwrites it. \param shape Shape object \param offset Offset void sfConvexShape_move(sfConvexShape* shape, sfVector2f offset);
func (ConvexShape) Rotate ¶
func (self ConvexShape) Rotate(angle float32)
\brief Rotate a convex shape This function adds to the current rotation of the object, unlike sfConvexShape_setRotation which overwrites it. \param shape Shape object \param angle Angle of rotation, in degrees void sfConvexShape_rotate(sfConvexShape* shape, float angle);
func (ConvexShape) Scale ¶
func (self ConvexShape) Scale(x, y float32)
\brief Scale a convex shape This function multiplies the current scale of the object, unlike sfConvexShape_setScale which overwrites it. \param shape Shape object \param factors Scale factors void sfConvexShape_scale(sfConvexShape* shape, sfVector2f factors);
func (ConvexShape) SetFillColor ¶
func (self ConvexShape) SetFillColor(color Color)
\brief Set the fill color of a convex shape This color is modulated (multiplied) with the shape's texture if any. It can be used to colorize the shape, or change its global opacity. You can use sfTransparent to make the inside of the shape transparent, and have the outline alone. By default, the shape's fill color is opaque white. \param shape Shape object \param color New color of the shape void sfConvexShape_setFillColor(sfConvexShape* shape, sfColor color);
func (ConvexShape) SetOutlineColor ¶
func (self ConvexShape) SetOutlineColor(color Color)
\brief Set the outline color of a convex shape You can use sfTransparent to disable the outline. By default, the shape's outline color is opaque white. \param shape Shape object \param color New outline color of the shape void sfConvexShape_setOutlineColor(sfConvexShape* shape, sfColor color);
func (ConvexShape) SetOutlineThickness ¶
func (self ConvexShape) SetOutlineThickness(thickness float32)
\brief Set the thickness of a convex shape's outline This number cannot be negative. Using zero disables the outline. By default, the outline thickness is 0. \param shape Shape object \param thickness New outline thickness void sfConvexShape_setOutlineThickness(sfConvexShape* shape, float thickness);
func (ConvexShape) SetPoint ¶
func (self ConvexShape) SetPoint(index uint, x, y float32)
\brief Set the position of a point in a convex shape Don't forget that the polygon must remain convex, and the points need to stay ordered! setPointCount must be called first in order to set the total number of points. The result is undefined if \a index is out of the valid range. \param shape Shape object \param index Index of the point to change, in range [0 .. GetPointCount() - 1] \param point New point void sfConvexShape_setPoint(sfConvexShape* shape, unsigned int index, sfVector2f point);
func (ConvexShape) SetPointCount ¶
func (self ConvexShape) SetPointCount(count uint)
\brief Set the number of points of a convex shap \a count must be greater than 2 to define a valid shape. \param shape Shape object \param count New number of points of the shape void sfConvexShape_setPointCount(sfConvexShape* shape, unsigned int count);
func (ConvexShape) SetScale ¶
func (self ConvexShape) SetScale(x, y float32)
\brief Set the scale factors of a convex shape This function completely overwrites the previous scale. See sfConvexShape_scale to add a factor based on the previous scale instead. The default scale of a circle Shape object is (1, 1). \param shape Shape object \param scale New scale factors void sfConvexShape_setScale(sfConvexShape* shape, sfVector2f scale);
func (ConvexShape) SetTexture ¶
func (self ConvexShape) SetTexture(txt Texture, resetRect bool)
\brief Change the source texture of a convex shape The \a texture argument refers to a texture that must exist as long as the shape uses it. Indeed, the shape doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the shape tries to use it, the behaviour is undefined. \a texture can be NULL to disable texturing. If \a resetRect is true, the TextureRect property of the shape is automatically adjusted to the size of the new texture. If it is false, the texture rect is left unchanged. \param shape Shape object \param texture New texture \param resetRect Should the texture rect be reset to the size of the new texture? void sfConvexShape_setTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect);
func (ConvexShape) Setorigin ¶
func (self ConvexShape) Setorigin(x, y float32)
\brief Set the local origin of a convex shape The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a circle Shape object is (0, 0). \param shape Shape object \param origin New origin void sfConvexShape_setOrigin(sfConvexShape* shape, sfVector2f origin);
func (ConvexShape) Setposition ¶
func (self ConvexShape) Setposition(position Vector2f)
\brief Set the position of a convex shape This function completely overwrites the previous position. See sfConvexShape_move to apply an offset based on the previous position instead. The default position of a circle Shape object is (0, 0). \param shape Shape object \param position New position void sfConvexShape_setPosition(sfConvexShape* shape, sfVector2f position);
func (ConvexShape) Setrotation ¶
func (self ConvexShape) Setrotation(angle float32)
\brief Set the orientation of a convex shape This function completely overwrites the previous rotation. See sfConvexShape_rotate to add an angle based on the previous rotation instead. The default rotation of a circle Shape object is 0. \param shape Shape object \param angle New rotation, in degrees void sfConvexShape_setRotation(sfConvexShape* shape, float angle);
func (ConvexShape) Settexturerect ¶
func (self ConvexShape) Settexturerect(rect IntRect)
\brief Set the sub-rectangle of the texture that a convex shape will display The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture. \param shape Shape object \param rect Rectangle defining the region of the texture to display void sfConvexShape_setTextureRect(sfConvexShape* shape, sfIntRect rect);
type Event ¶
func (Event) ToJoystickButtonEvent ¶
func (self Event) ToJoystickButtonEvent() JoystickButtonEvent
func (Event) ToJoystickConnectEvent ¶
func (self Event) ToJoystickConnectEvent() JoystickConnectEvent
func (Event) ToJoystickMoveEvent ¶
func (self Event) ToJoystickMoveEvent() JoystickMoveEvent
func (Event) ToKeyEvent ¶
func (Event) ToMouseButtonEvent ¶
func (self Event) ToMouseButtonEvent() MouseButtonEvent
func (Event) ToMouseMoveEvent ¶
func (self Event) ToMouseMoveEvent() MouseMoveEvent
func (Event) ToMouseWheelEvent ¶
func (self Event) ToMouseWheelEvent() MouseWheelEvent
func (Event) ToSizeEvent ¶
func (Event) ToTextEvent ¶
type EventType ¶
type EventType uint
const ( EvtClosed EventType = iota EvtResized EvtLostFocus EvtGainedFocus EvtTextEntered EvtKeyPressed EvtKeyReleased EvtMouseWheelMoved EvtMouseButtonPressed EvtMouseButtonReleased EvtMouseMoved EvtMouseEntered EvtMouseLeft EvtJoystickButtonPressed EvtJoystickButtonReleased EvtJoystickMoved EvtJoystickConnected EvtJoystickDisconnected EvtNone // go introduction. )
type FloatRect ¶
type FloatRect struct {
Cref *C.sfFloatRect
}
------------------------------------------------------------------
func NewFloatRect ¶
func (FloatRect) Intersects ¶
brief Check intersection between two rectangles param rect1 First rectangle to test param rect2 Second rectangle to test param intersection Rectangle to be filled with overlapping rect (can be NULL) return sfTrue if rectangles overlap sfBool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* // intersection);
type Font ¶
func FontFromFile ¶
\brief Create a new font from a file \param filename Path of the font file to load \return A new sfFont object, or NULL if it failed sfFont* sfFont_createFromFile(const char* filename);
func (Font) Copy ¶
\brief Copy an existing font \param font Font to copy \return Copied object sfFont* sfFont_copy(sfFont* font);
func (Font) Destroy ¶
func (self Font) Destroy()
\brief Destroy an existing font \param font Font to delete void sfFont_destroy(sfFont* font);
func (Font) Glyph ¶
\brief Get a glyph in a font \param font Source font \param codePoint Unicode code point of the character to get \param characterSize Character size, in pixels \param bold Retrieve the bold version or the regular one? \return The corresponding glyph sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold);
func (Font) Kerning ¶
\brief Get the kerning value corresponding to a given pair of characters in a font \param font Source font \param first Unicode code point of the first character \param second Unicode code point of the second character \param characterSize Character size, in pixels \return Kerning offset, in pixels int sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
func (Font) LineSpacing ¶
\brief Get the line spacing value \param font Source font \param codePoint Unicode code point of the character to get \param characterSize Character size, in pixels \return Line spacing, in pixels int sfFont_getLineSpacing(sfFont* font, unsigned int characterSize);
type Image ¶
func ImageFromColor ¶
Create an image and fill it with a unique color width Width of the image height Height of the image color Fill color return A new sfImage object sfImage* sfImage_createFromColor(unsigned int width, unsigned int height, sfColor color);
func ImageFromFile ¶
Create an image from a file on disk The supported image formats are bmp, png, tga, jpg, gif, psd, hdr and pic. Some format options are not supported, like progressive jpeg. If this function fails, the image is left unchanged. \param filename Path of the image file to load \return A new sfImage object, or NULL if it failed sfImage* sfImage_createFromFile(const char* filename);
func ImageFromPixels ¶
Create an image from an array of pixels The \a pixel array is assumed to contain 32-bits RGBA pixels, and have the given \a width and \a height. If not, this is an undefined behaviour. If \a pixels is null, an empty image is created. \param width Width of the image \param height Height of the image \param pixels Array of pixels to copy to the image \return A new sfImage object sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const sfUint8* pixels);
func NewImage ¶
Create an image This image is filled with black pixels. width Width of the image height Height of the image return A new Image object sfImage* sfImage_create(unsigned int width, unsigned int height);
func (Image) Copy ¶
Copy an existing image
\param image Image to copy \return Copied object sfImage* sfImage_copy(sfImage* image);
func (Image) CopyImage ¶
Copy pixels from an image onto another
This function does a slow pixel copy and should not be used intensively. It can be used to prepare a complex static image from several others, but if you need this kind of feature in real-time you'd better use sfRenderTexture. If \a sourceRect is empty, the whole image is copied. If \a applyAlpha is set to true, the transparency of source pixels is applied. If it is false, the pixels are copied unchanged with their alpha value. \param image Image object \param source Source image to copy \param destX X coordinate of the destination position \param destY Y coordinate of the destination position \param sourceRect Sub-rectangle of the source image to copy \param applyAlpha Should the copy take in account the source transparency? void sfImage_copyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha);
func (Image) Destroy ¶
func (self Image) Destroy()
Destroy an existing image
\param image Image to delete void sfImage_destroy(sfImage* image);
func (Image) FlipHorizontally ¶
func (self Image) FlipHorizontally()
Flip an image horizontally (left <-> right)
\param image Image object void sfImage_flipHorizontally(sfImage* image);
func (Image) FlipVertically ¶
func (self Image) FlipVertically()
func (Image) Pixel ¶
Get the color of a pixel in an image
This function doesn't check the validity of the pixel coordinates, using out-of-range values will result in an undefined behaviour. \param image Image object \param x X coordinate of pixel to get \param y Y coordinate of pixel to get \return Color of the pixel at coordinates (x, y) sfColor sfImage_getPixel(const sfImage* image, unsigned int x, unsigned int y);
func (Image) Savetofile ¶
Save an image to a file on disk
The format of the image is automatically deduced from the extension. The supported image formats are bmp, png, tga and jpg. The destination file is overwritten if it already exists. This function fails if the image is empty. \param image Image object \param filename Path of the file to save \return sfTrue if saving was successful sfBool sfImage_saveToFile(const sfImage* image, const char* filename);
func (Image) SetPixel ¶
Change the color of a pixel in an image
This function doesn't check the validity of the pixel coordinates, using out-of-range values will result in an undefined behaviour. \param image Image object \param x X coordinate of pixel to change \param y Y coordinate of pixel to change \param color New color of the pixel void sfImage_setPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color);
type IntRect ¶
func NewIntRect ¶
func (IntRect) Intersects ¶
brief Check intersection between two rectangles param rect1 First rectangle to test param rect2 Second rectangle to test param intersection Rectangle to be filled with overlapping rect (can be NULL) return sfTrue if rectangles overlap sfBool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* // intersection);
type Joystick ¶
type Joystick uint
func (Joystick) AxisPosition ¶
func (self Joystick) AxisPosition(axis JoystickAxis) float32
Get the current position of a joystick axis If the joystick is not connected, this function returns 0. \param joystick Index of the joystick \param axis Axis to check \return Current position of the axis, in range [-100 .. 100] float sfJoystick_getAxisPosition(unsigned int joystick, sfJoystickAxis axis);
func (Joystick) ButtonCount ¶
Return the number of buttons supported by a joystick If the joystick is not connected, this function returns 0. \param joystick Index of the joystick \return Number of buttons supported by the joystick unsigned int sfJoystick_getButtonCount(unsigned int joystick);
func (Joystick) HasAxis ¶
func (self Joystick) HasAxis(axis JoystickAxis) bool
Check if a joystick supports a given axis If the joystick is not connected, this function returns false. \param joystick Index of the joystick \param axis Axis to check \return sfTrue if the joystick supports the axis, sfFalse otherwise sfBool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis axis);
func (Joystick) IsButtonPressed ¶
Check if a joystick button is pressed If the joystick is not connected, this function returns false. \param joystick Index of the joystick \param button Button to check \return sfTrue if the button is pressed, sfFalse otherwise sfBool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button);
func (Joystick) Isconnected ¶
Check if a joystick is connected \param joystick Index of the joystick to check \return sfTrue if the joystick is connected, sfFalse otherwise sfBool sfJoystick_isConnected(unsigned int joystick);
func (Joystick) Update ¶
func (self Joystick) Update()
Update the states of all joysticks This function is used internally by SFML, so you normally don't have to call it explicitely. However, you may need to call it if you have no window yet (or no window at all): in this case the joysticks states are not updated automatically. void sfJoystick_update(void);
type JoystickAxis ¶
type JoystickAxis struct {
Cref *C.sfJoystickAxis
}
type JoystickButtonEvent ¶
type JoystickButtonEvent struct { Type EventType Cref *C.sfJoystickButtonEvent }
////////////////////////////////////////////////////////// / \brief Joystick buttons events parameters / ////////////////////////////////////////////////////////// struct sfJoystickButtonEvent
{ sfEventType type; unsigned int joystickId; unsigned int button; };
func (JoystickButtonEvent) Button ¶
func (self JoystickButtonEvent) Button() uint
func (JoystickButtonEvent) JoystickID ¶
func (self JoystickButtonEvent) JoystickID() uint
type JoystickConnectEvent ¶
type JoystickConnectEvent struct { Type EventType Cref *C.sfJoystickConnectEvent }
////////////////////////////////////////////////////////// / \brief Joystick connection/disconnection event parameters / ////////////////////////////////////////////////////////// struct sfJoystickConnectEvent
{ sfEventType type; unsigned int joystickId; };
func (JoystickConnectEvent) JoystickID ¶
func (self JoystickConnectEvent) JoystickID() uint
type JoystickMoveEvent ¶
type JoystickMoveEvent struct { Type EventType Cref *C.sfJoystickMoveEvent }
////////////////////////////////////////////////////////// / \brief Joystick axis move event parameters / ////////////////////////////////////////////////////////// struct sfJoystickMoveEvent
{ sfEventType type; unsigned int joystickId; sfJoystickAxis axis; float position; };
func (JoystickMoveEvent) Axis ¶
func (self JoystickMoveEvent) Axis() JoystickAxis
func (JoystickMoveEvent) JoystickID ¶
func (self JoystickMoveEvent) JoystickID() uint
func (JoystickMoveEvent) Position ¶
func (self JoystickMoveEvent) Position() float32
type KeyCode ¶
type KeyCode uint
const ( KeyA KeyCode = iota // The A key KeyB // The B key KeyC // The C key KeyD // The D key KeyE // The E key KeyF // The F key KeyG // The G key KeyH // The H key KeyI // The I key KeyJ // The J key KeyK // The K key KeyL // The L key KeyM // The M key KeyN // The N key KeyO // The O key KeyP // The P key KeyQ // The Q key KeyR // The R key KeyS // The S key KeyT // The T key KeyU // The U key KeyV // The V key KeyW // The W key KeyX // The X key KeyY // The Y key KeyZ // The Z key KeyNum0 // The 0 key KeyNum1 // The 1 key KeyNum2 // The 2 key KeyNum3 // The 3 key KeyNum4 // The 4 key KeyNum5 // The 5 key KeyNum6 // The 6 key KeyNum7 // The 7 key KeyNum8 // The 8 key KeyNum9 // The 9 key KeyEscape // The Escape key KeyLControl // The left Control key KeyLShift // The left Shift key KeyLAlt // The left Alt key KeyLSystem // The left OS specific key [Win | apple key] KeyRControl // The right Control key KeyRShift // The right Shift key KeyRAlt // The right Alt key KeyRSystem // The right OS specific key [Win | apple key] KeyMenu // The Menu key KeyLBracket // The [ key KeyRBracket // The ] key KeySemiColon // The ; key KeyComma // The key KeyPeriod // The . key KeyQuote // The ' key KeySlash // The / key KeyBackSlash // The \ key KeyTilde // The ~ key KeyEqual // The = key KeyDash // The - key KeySpace // The Space key KeyReturn // The Return key KeyBack // The Backspace key KeyTab // The Tabulation key KeyPageUp // The Page up key KeyPageDown // The Page down key KeyEnd // The End key KeyHome // The Home key KeyInsert // The Insert key KeyDelete // The Delete key KeyAdd // + KeySubtract // - KeyMultiply // * KeyDivide // / KeyLeft // Left arrow KeyRight // Right arrow KeyUp // Up arrow KeyDown // Down arrow KeyNumpad0 // The numpad 0 key KeyNumpad1 // The numpad 1 key KeyNumpad2 // The numpad 2 key KeyNumpad3 // The numpad 3 key KeyNumpad4 // The numpad 4 key KeyNumpad5 // The numpad 5 key KeyNumpad6 // The numpad 6 key KeyNumpad7 // The numpad 7 key KeyNumpad8 // The numpad 8 key KeyNumpad9 // The numpad 9 key KeyF1 // The F1 key KeyF2 // The F2 key KeyF3 // The F3 key KeyF4 // The F4 key KeyF5 // The F5 key KeyF6 // The F6 key KeyF7 // The F7 key KeyF8 // The F8 key KeyF9 // The F8 key KeyF10 // The F10 key KeyF11 // The F11 key KeyF12 // The F12 key KeyF13 // The F13 key KeyF14 // The F14 key KeyF15 // The F15 key KeyPause // The Pause key KeyCount // Keep last -- the total number of keyboard keys )
type KeyEvent ¶
type KeyEvent struct { Type EventType Cref *C.sfKeyEvent }
type MouseButton ¶
type MouseButton uint
func (MouseButton) IsButtonPressed ¶
func (self MouseButton) IsButtonPressed() bool
Check if a mouse button is pressed Returns true if the button is pressed, false otherwise
type MouseButtonEvent ¶
type MouseButtonEvent struct { Type EventType Cref *C.sfMouseButtonEvent }
////////////////////////////////////////////////////////// / \brief Mouse buttons events parameters / ////////////////////////////////////////////////////////// struct sfMouseButtonEvent
{ sfEventType type; sfMouseButton button; int x; int y; };
func (MouseButtonEvent) Button ¶
func (self MouseButtonEvent) Button() MouseButton
func (MouseButtonEvent) X ¶
func (self MouseButtonEvent) X() int
func (MouseButtonEvent) Y ¶
func (self MouseButtonEvent) Y() int
type MouseMoveEvent ¶
type MouseMoveEvent struct { Type EventType Cref *C.sfMouseMoveEvent }
////////////////////////////////////////////////////////// / \brief Mouse move event parameters / ////////////////////////////////////////////////////////// struct sfMouseMoveEvent
{ sfEventType type; int x; int y; };
func (MouseMoveEvent) X ¶
func (self MouseMoveEvent) X() int
func (MouseMoveEvent) Y ¶
func (self MouseMoveEvent) Y() int
type MouseWheelEvent ¶
type MouseWheelEvent struct { Type EventType Cref *C.sfMouseWheelEvent }
////////////////////////////////////////////////////////// / \brief Mouse wheel events parameters / ////////////////////////////////////////////////////////// struct sfMouseWheelEvent
{ sfEventType type; int delta; int x; int y; };
func (MouseWheelEvent) Delta ¶
func (self MouseWheelEvent) Delta() int
func (MouseWheelEvent) X ¶
func (self MouseWheelEvent) X() int
func (MouseWheelEvent) Y ¶
func (self MouseWheelEvent) Y() int
type Music ¶
func NewMusicFromFile ¶
Create a new music and load it from a file This function doesn't start playing the music (call Play() to do so). Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64. \param filename Path of the music file to open \return A new sfMusic object (NULL if failed)
func NewMusicFromMemory ¶
\brief Create a new music and load it from a file in memory This function doesn't start playing the music (call sfMusic_play to do so). Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64. \param data Pointer to the file data in memory \param sizeInBytes Size of the data to load, in bytes \return A new sfMusic object (NULL if failed) sfMusic* sfMusic_createFromMemory(const void* data, size_t sizeInBytes);
func (Music) GetChannelCount ¶
\brief Return the number of channels of a music 1 channel means a mono sound, 2 means stereo, etc. \param music Music object \return Number of channels unsigned int sfMusic_getChannelCount(const sfMusic* music);
func (Music) GetDuration ¶
\brief Get the total duration of a music \param music Music object \return Music duration sfTime sfMusic_getDuration(const sfMusic* music);
func (Music) GetLoop ¶
\brief Tell whether or not a music is in loop mode \param music Music object \return sfTrue if the music is looping, sfFalse otherwise sfBool sfMusic_getLoop(const sfMusic* music);
func (Music) GetPitch ¶
\brief Get the pitch of a music \param music Music object \return Pitch of the music float sfMusic_getPitch(const sfMusic* music);
func (Music) GetPlayingOffset ¶
\brief Get the current playing position of a music \param music Music object \return Current playing position sfTime sfMusic_getPlayingOffset(const sfMusic* music);
func (Music) GetPosition ¶
\brief Get the 3D position of a music in the audio scene \param music Music object \return Position of the music in the world sfVector3f sfMusic_getPosition(const sfMusic* music);
func (Music) GetSampleRate ¶
\brief Get the sample rate of a music The sample rate is the number of audio samples played per second. The higher, the better the quality. \param music Music object \return Sample rate, in number of samples per second unsigned int sfMusic_getSampleRate(const sfMusic* music);
func (Music) GetStatus ¶
func (self Music) GetStatus() SoundStatus
\brief Get the current status of a music (stopped, paused, playing) \param music Music object \return Current status sfSoundStatus sfMusic_getStatus(const sfMusic* music);
func (Music) GetVolume ¶
\brief Get the volume of a music \param music Music object \return Volume of the music, in the range [0, 100] float sfMusic_getVolume(const sfMusic* music);
func (Music) Getattenuation ¶
\brief Get the attenuation factor of a music \param music Music object \return Attenuation factor of the music float sfMusic_getAttenuation(const sfMusic* music);
func (Music) Getmindistance ¶
\brief Get the minimum distance of a music \param music Music object \return Minimum distance of the music float sfMusic_getMinDistance(const sfMusic* music);
func (Music) IsRelativeToListener ¶
\brief Tell whether a music's position is relative to the
listener or is absolute
\param music Music object \return sfTrue if the position is relative, sfFalse if it's absolute sfBool sfMusic_isRelativeToListener(const sfMusic* music);
func (Music) Pause ¶
func (self Music) Pause()
\brief Pause a music This function pauses the music if it was playing, otherwise (music already paused or stopped) it has no effect. \param music Music object void sfMusic_pause(sfMusic* music);
func (Music) Play ¶
func (self Music) Play()
\brief Start or resume playing a music This function starts the music if it was stopped, resumes it if it was paused, and restarts it from beginning if it was it already playing. This function uses its own thread so that it doesn't block the rest of the program while the music is played. \param music Music object void sfMusic_play(sfMusic* music);
func (Music) SetAttenuation ¶
\brief Set the attenuation factor of a music The attenuation is a multiplicative factor which makes the music more or less loud according to its distance from the listener. An attenuation of 0 will produce a non-attenuated music, i.e. its volume will always be the same whether it is heard from near or from far. On the other hand, an attenuation value such as 100 will make the music fade out very quickly as it gets further from the listener. The default value of the attenuation is 1. \param music Music object \param attenuation New attenuation factor of the music void sfMusic_setAttenuation(sfMusic* music, float attenuation);
func (Music) SetLoop ¶
\brief Set whether or not a music should loop after reaching the end If set, the music will restart from beginning after reaching the end and so on, until it is stopped or sfMusic_setLoop(music, sfFalse) is called. The default looping state for musics is false. \param music Music object \param loop sfTrue to play in loop, sfFalse to play once void sfMusic_setLoop(sfMusic* music, sfBool loop);
func (Music) SetMinDistance ¶
\brief Set the minimum distance of a music The "minimum distance" of a music is the maximum distance at which it is heard at its maximum volume. Further than the minimum distance, it will start to fade out according to its attenuation factor. A value of 0 ("inside the head of the listener") is an invalid value and is forbidden. The default value of the minimum distance is 1. \param music Music object \param distance New minimum distance of the music void sfMusic_setMinDistance(sfMusic* music, float distance);
func (Music) SetPitch ¶
\brief Set the pitch of a music The pitch represents the perceived fundamental frequency of a sound; thus you can make a music more acute or grave by changing its pitch. A side effect of changing the pitch is to modify the playing speed of the music as well. The default value for the pitch is 1. \param music Music object \param pitch New pitch to apply to the music void sfMusic_setPitch(sfMusic* music, float pitch);
func (Music) SetPlayingOffset ¶
\brief Change the current playing position of a music The playing position can be changed when the music is either paused or playing. \param music Music object \param timeOffset New playing position, in milliseconds void sfMusic_setPlayingOffset(sfMusic* music, sfTime timeOffset); TODO: file this doc as a bug, the second arg is sfTime, not int.
func (Music) SetPosition ¶
\brief Set the 3D position of a music in the audio scene Only musics with one channel (mono musics) can be spatialized. The default position of a music is (0, 0, 0). \param music Music object \param position Position of the music in the scene void sfMusic_setPosition(sfMusic* music, sfVector3f position);
func (Music) SetRelativeToListener ¶
\brief Make a musics's position relative to the listener or absolute Making a music relative to the listener will ensure that it will always be played the same way regardless the position of the listener. This can be useful for non-spatialized musics, musics that are produced by the listener, or musics attached to it. The default value is false (position is absolute). \param music Music object \param relative sfTrue to set the position relative, sfFalse to set it absolute void sfMusic_setRelativeToListener(sfMusic* music, sfBool relative);
type PrimitiveType ¶
type PrimitiveType uint
type RectangleShape ¶
type RectangleShape struct {
Cref *C.sfRectangleShape
}
func NewRectangleShape ¶
func NewRectangleShape() RectangleShape
Create a new rectangle shape \return A new sfRectangleShape object, or NULL if it failed sfRectangleShape* sfRectangleShape_create(void);
func (RectangleShape) Copy ¶
func (self RectangleShape) Copy() RectangleShape
Copy an existing rectangle shape \param shape Shape to copy \return Copied object sfRectangleShape* sfRectangleShape_copy(sfRectangleShape* shape);
func (RectangleShape) Destroy ¶
func (self RectangleShape) Destroy()
Destroy an existing rectangle shape \param Shape Shape to delete void sfRectangleShape_destroy(sfRectangleShape* shape);
func (RectangleShape) FillColor ¶
func (self RectangleShape) FillColor() Color
Get the fill color of a rectangle shape \param shape Shape object \return Fill color of the shape sfColor sfRectangleShape_getFillColor(const sfRectangleShape* shape);
func (RectangleShape) GetScale ¶
func (self RectangleShape) GetScale() (float32, float32)
Get the current scale of a rectangle shape \param shape Shape object \return Current scale factors sfVector2f sfRectangleShape_getScale(const sfRectangleShape* shape);
func (RectangleShape) GlobalBounds ¶
func (self RectangleShape) GlobalBounds() FloatRect
Get the global bounding rectangle of a rectangle shape The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system. \param shape Shape object \return Global bounding rectangle of the entity
func (RectangleShape) InverseTransform ¶
func (self RectangleShape) InverseTransform() Transform
Get the inverse of the combined transform of a rectangle shape \param shape shape object \return Inverse of the combined transformations applied to the object const sfTransform* sfRectangleShape_getInverseTransform(const sfRectangleShape* shape);
func (RectangleShape) LocalBounds ¶
func (self RectangleShape) LocalBounds() FloatRect
Get the local bounding rectangle of a rectangle shape The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system. \param shape Shape object \return Local bounding rectangle of the entity sfFloatRect sfRectangleShape_getLocalBounds(const sfRectangleShape* shape);
func (RectangleShape) Move ¶
func (self RectangleShape) Move(x, y float32)
Move a rectangle shape by a given offset This function adds to the current position of the object, unlike sfRectangleShape_setPosition which overwrites it. \param shape Shape object \param offset Offset void sfRectangleShape_move(sfRectangleShape* shape, sfVector2f offset);
func (RectangleShape) Origin ¶
func (self RectangleShape) Origin() (float32, float32)
Get the local origin of a rectangle shape \param shape Shape object \return Current origin sfVector2f sfRectangleShape_getOrigin(const sfRectangleShape* shape);
func (RectangleShape) OutlineColor ¶
func (self RectangleShape) OutlineColor() Color
Get the outline color of a rectangle shape \param shape Shape object \return Outline color of the shape sfColor sfRectangleShape_getOutlineColor(const sfRectangleShape* shape);
func (RectangleShape) OutlinkThickness ¶
func (self RectangleShape) OutlinkThickness() float32
Get the outline thickness of a rectangle shape \param shape Shape object \return Outline thickness of the shape float sfRectangleShape_getOutlineThickness(const sfRectangleShape* shape);
func (RectangleShape) Point ¶
func (self RectangleShape) Point(index uint) (float32, float32)
Get a point of a rectangle shape The result is undefined if \a index is out of the valid range. \param shape Shape object \param index Index of the point to get, in range [0 .. getPointCount() - 1] \return Index-th point of the shape sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, unsigned int index);
func (RectangleShape) PointCount ¶
func (self RectangleShape) PointCount() int
Get the total number of points of a rectangle shape \param shape Shape object \return Number of points of the shape unsigned int sfRectangleShape_getPointCount(const sfRectangleShape* shape);
func (RectangleShape) Position ¶
func (self RectangleShape) Position() (float32, float32)
Get the position of a rectangle shape \param shape Shape object \return Current position sfVector2f sfRectangleShape_getPosition(const sfRectangleShape* shape);
func (RectangleShape) Rotate ¶
func (self RectangleShape) Rotate(angle float32)
Rotate a rectangle shape This function adds to the current rotation of the object, unlike sfRectangleShape_setRotation which overwrites it. \param shape Shape object \param angle Angle of rotation, in degrees void sfRectangleShape_rotate(sfRectangleShape* shape, float angle);
func (RectangleShape) Rotation ¶
func (self RectangleShape) Rotation() float32
Get the orientation of a rectangle shape The rotation is always in the range [0, 360]. \param shape Shape object \return Current rotation, in degrees float sfRectangleShape_getRotation(const sfRectangleShape* shape);
func (RectangleShape) Scale ¶
func (self RectangleShape) Scale(x, y float32)
Scale a rectangle shape This function multiplies the current scale of the object, unlike sfRectangleShape_setScale which overwrites it. \param shape Shape object \param factors Scale factors void sfRectangleShape_scale(sfRectangleShape* shape, sfVector2f factors);
func (RectangleShape) SetFillColor ¶
func (self RectangleShape) SetFillColor(color Color)
Set the fill color of a rectangle shape This color is modulated (multiplied) with the shape's texture if any. It can be used to colorize the shape, or change its global opacity. You can use sfTransparent to make the inside of the shape transparent, and have the outline alone. By default, the shape's fill color is opaque white. \param shape Shape object \param color New color of the shape void sfRectangleShape_setFillColor(sfRectangleShape* shape, sfColor color);
func (RectangleShape) SetOrigin ¶
func (self RectangleShape) SetOrigin(x, y float32)
Set the local origin of a rectangle shape The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a circle Shape object is (0, 0). \param shape Shape object \param origin New origin void sfRectangleShape_setOrigin(sfRectangleShape* shape, sfVector2f origin);
func (RectangleShape) SetOutlineColor ¶
func (self RectangleShape) SetOutlineColor(color Color)
Set the outline color of a rectangle shape You can use sfTransparent to disable the outline. By default, the shape's outline color is opaque white. \param shape Shape object \param color New outline color of the shape void sfRectangleShape_setOutlineColor(sfRectangleShape* shape, sfColor color);
func (RectangleShape) SetOutlineThickness ¶
func (self RectangleShape) SetOutlineThickness(thickness float32)
Set the thickness of a rectangle shape's outline This number cannot be negative. Using zero disables the outline. By default, the outline thickness is 0. \param shape Shape object \param thickness New outline thickness void sfRectangleShape_setOutlineThickness(sfRectangleShape* shape, float thickness);
func (RectangleShape) SetPosition ¶
func (self RectangleShape) SetPosition(x, y float32)
Set the position of a rectangle shape This function completely overwrites the previous position. See sfRectangleShape_move to apply an offset based on the previous position instead. The default position of a circle Shape object is (0, 0). \param shape Shape object \param position New position void sfRectangleShape_setPosition(sfRectangleShape* shape, sfVector2f position);
func (RectangleShape) SetRotation ¶
func (self RectangleShape) SetRotation(angle float32)
Set the orientation of a rectangle shape This function completely overwrites the previous rotation. See sfRectangleShape_rotate to add an angle based on the previous rotation instead. The default rotation of a circle Shape object is 0. \param shape Shape object \param angle New rotation, in degrees void sfRectangleShape_setRotation(sfRectangleShape* shape, float angle);
func (RectangleShape) SetScale ¶
func (self RectangleShape) SetScale(x, y float32)
Set the scale factors of a rectangle shape This function completely overwrites the previous scale. See sfRectangleShape_scale to add a factor based on the previous scale instead. The default scale of a circle Shape object is (1, 1). \param shape Shape object \param scale New scale factors void sfRectangleShape_setScale(sfRectangleShape* shape, sfVector2f scale);
func (RectangleShape) SetSize ¶
func (self RectangleShape) SetSize(x, y float32)
Set the size of a rectangle shape \param shape Shape object \param size New size of the rectangle void sfRectangleShape_setSize(sfRectangleShape* shape, sfVector2f size);
func (RectangleShape) SetTexture ¶
func (self RectangleShape) SetTexture(tex Texture, resetRect bool)
Change the source texture of a rectangle shape The \a texture argument refers to a texture that must exist as long as the shape uses it. Indeed, the shape doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the shape tries to use it, the behaviour is undefined. \a texture can be NULL to disable texturing. If \a resetRect is true, the TextureRect property of the shape is automatically adjusted to the size of the new texture. If it is false, the texture rect is left unchanged. \param shape Shape object \param texture New texture \param resetRect Should the texture rect be reset to the size of the new texture? void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect);
func (RectangleShape) SetTextureRect ¶
func (self RectangleShape) SetTextureRect(rect IntRect)
Set the sub-rectangle of the texture that a rectangle shape will display The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture. \param shape Shape object \param rect Rectangle defining the region of the texture to display void sfRectangleShape_setTextureRect(sfRectangleShape* shape, sfIntRect rect);
func (RectangleShape) Size ¶
func (self RectangleShape) Size() (float32, float32)
Get the size of a rectangle shape \param shape Shape object \return height Size of the rectangle sfVector2f sfRectangleShape_getSize(const sfRectangleShape* shape);
func (RectangleShape) Texture ¶
func (self RectangleShape) Texture() Texture
Get the source texture of a rectangle shape If the shape has no source texture, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the texture when you retrieve it with this function. \param shape Shape object \return Pointer to the shape's texture const sfTexture* sfRectangleShape_getTexture(const sfRectangleShape* shape);
func (RectangleShape) TextureRect ¶
func (self RectangleShape) TextureRect() IntRect
Get the sub-rectangle of the texture displayed by a rectangle shape \param shape Shape object \return Texture rectangle of the shape sfIntRect sfRectangleShape_getTextureRect(const sfRectangleShape* shape);
func (RectangleShape) Transform ¶
func (self RectangleShape) Transform() Transform
Get the combined transform of a rectangle shape \param shape shape object \return Transform combining the position/rotation/scale/origin of the object const sfTransform* sfRectangleShape_getTransform(const sfRectangleShape* shape);
type RenderTexture ¶
type RenderTexture struct {
Cref *C.sfRenderTexture
}
func NewRenderTexture ¶
func NewRenderTexture(width, height uint, depthBuffer bool) RenderTexture
Construct a new render texture \param width Width of the render texture \param height Height of the render texture \param depthBuffer Do you want a depth-buffer attached? (useful only if you're doing 3D OpenGL on the rendertexture) \return A new sfRenderTexture object, or NULL if it failed sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer);
func (RenderTexture) Clear ¶
func (self RenderTexture) Clear(color Color)
Clear the rendertexture with the given color \param renderTexture Render texture object \param color Fill color void sfRenderTexture_clear(sfRenderTexture* renderTexture, sfColor color);
func (RenderTexture) Destroy ¶
func (self RenderTexture) Destroy()
Destroy an existing render texture \param renderTexture Render texture to destroy void sfRenderTexture_destroy(sfRenderTexture* renderTexture);
func (RenderTexture) Display ¶
func (self RenderTexture) Display()
Update the contents of the target texture \param renderTexture Render texture object void sfRenderTexture_display(sfRenderTexture* renderTexture);
func (RenderTexture) DrawCircleShapeDefault ¶
func (self RenderTexture) DrawCircleShapeDefault(obj CircleShape)
void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states);
func (RenderTexture) DrawRectangleShapeDefault ¶
func (self RenderTexture) DrawRectangleShapeDefault(obj RectangleShape)
void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states);
func (RenderTexture) DrawSpriteDefault ¶
func (self RenderTexture) DrawSpriteDefault(obj Sprite)
Draw a drawable object to the render-target \param renderTexture Render texture object \param object Object to draw \param states Render states to use for drawing (NULL to use the default states) void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states);
func (RenderTexture) DrawTextDefault ¶
func (self RenderTexture) DrawTextDefault(obj Text)
void sfRenderTexture_drawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states);
func (RenderTexture) IsSmooth ¶
func (self RenderTexture) IsSmooth() bool
Tell whether the smooth filter is enabled or not for a render texture \param renderTexture Render texture object \return sfTrue if smoothing is enabled, sfFalse if it is disabled sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture);
func (RenderTexture) PopGLStates ¶
func (self RenderTexture) PopGLStates()
Restore the previously saved OpenGL render states and matrices See the description of pushGLStates to get a detailed description of these functions. \param renderTexture Render texture object void sfRenderTexture_popGLStates(sfRenderTexture* renderTexture);
func (RenderTexture) PushGLStates ¶
func (self RenderTexture) PushGLStates()
Save the current OpenGL render states and matrices This function can be used when you mix SFML drawing and direct OpenGL rendering. Combined with popGLStates, it ensures that: \li SFML's internal states are not messed up by your OpenGL code \li your OpenGL states are not modified by a call to a SFML function Note that this function is quite expensive: it saves all the possible OpenGL states and matrices, even the ones you don't care about. Therefore it should be used wisely. It is provided for convenience, but the best results will be achieved if you handle OpenGL states yourself (because you know which states have really changed, and need to be saved and restored). Take a look at the resetGLStates function if you do so. \param renderTexture Render texture object void sfRenderTexture_pushGLStates(sfRenderTexture* renderTexture);
func (RenderTexture) ResetGLStates ¶
func (self RenderTexture) ResetGLStates()
Reset the internal OpenGL states so that the target is ready for drawing This function can be used when you mix SFML drawing and direct OpenGL rendering, if you choose not to use pushGLStates/popGLStates. It makes sure that all OpenGL states needed by SFML are set, so that subsequent sfRenderTexture_draw*() calls will work as expected. \param renderTexture Render texture object void sfRenderTexture_resetGLStates(sfRenderTexture* renderTexture);
func (RenderTexture) SetActive ¶
func (self RenderTexture) SetActive(active bool) bool
Activate or deactivate a render texture as the current target for rendering \param renderTexture Render texture object \param active sfTrue to activate, sfFalse to deactivate \return True if operation was successful, false otherwise sfBool sfRenderTexture_setActive(sfRenderTexture* renderTexture, sfBool active);
func (RenderTexture) SetSmooth ¶
func (self RenderTexture) SetSmooth(smooth bool)
Enable or disable the smooth filter on a render texture \param renderTexture Render texture object \param smooth sfTrue to enable smoothing, sfFalse to disable it void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth);
func (RenderTexture) Size ¶
func (self RenderTexture) Size() (uint, uint)
Get the size of the rendering region of a render texture \param renderTexture Render texture object \return Size in pixels sfVector2u sfRenderTexture_getSize(const sfRenderTexture* renderTexture);
func (RenderTexture) Texture ¶
func (self RenderTexture) Texture() Texture
Get the target texture of a render texture \param renderTexture Render texture object \return Pointer to the target texture const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture);
type RenderWindow ¶
type RenderWindow struct {
Cref *C.sfRenderWindow
}
func NewRenderWindow ¶
func NewRenderWindow(mode VideoMode, title string, style uint32, settings ContextSettings) RenderWindow
\brief Construct a new render window
\param mode Video mode to use \param title Title of the window \param style Window style \param settings Creation settings (pass NULL to use default values)
sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
func NewRenderWindowDefault ¶
func NewRenderWindowDefault(mode VideoMode, title string) RenderWindow
func (RenderWindow) Capture ¶
func (self RenderWindow) Capture() Image
Copy the current contents of a render window to an image This is a slow operation, whose main purpose is to make screenshots of the application. If you want to update an image with the contents of the window and then use it for drawing, you should rather use a sfTexture and its update(sfWindow*) function. You can also draw things directly to a texture with the sfRenderWindow class. \param renderWindow Render window object \return New image containing the captured contents sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
func (RenderWindow) Clear ¶
func (self RenderWindow) Clear(color Color)
Clear a render window with the given color \param renderWindow Render window object \param color Fill color void sfRenderWindow_clear(sfRenderWindow* renderWindow, sfColor color);
func (RenderWindow) Close ¶
func (self RenderWindow) Close()
Close a render window (but doesn't destroy the internal data) \param renderWindow Render window to close void sfRenderWindow_close(sfRenderWindow* renderWindow);
func (RenderWindow) Destroy ¶
func (self RenderWindow) Destroy()
Destroy an existing render window \param renderWindow Render window to destroy void sfRenderWindow_destroy(sfRenderWindow* renderWindow);
func (RenderWindow) Display ¶
func (self RenderWindow) Display()
Display a render window on screen \param renderWindow Render window object void sfRenderWindow_display(sfRenderWindow* renderWindow);
func (RenderWindow) Drain ¶
func (self RenderWindow) Drain()
func (RenderWindow) DrawCircleShapeDefault ¶
func (self RenderWindow) DrawCircleShapeDefault(obj CircleShape)
void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states);
func (RenderWindow) DrawRectangleShapeDefault ¶
func (self RenderWindow) DrawRectangleShapeDefault(obj RectangleShape)
void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states);
func (RenderWindow) DrawSpriteDefault ¶
func (self RenderWindow) DrawSpriteDefault(obj Sprite)
// Change the current active view of a render window // \param renderWindow Render window object // \param view Pointer to the new view // void sfRenderWindow_setView(sfRenderWindow* renderWindow, const sfView* view);
func (self RenderWindow) Setview(view *View ) void { return C.sfRenderWindow_setView(self.Cref, sf(*View)); }
// Get the current active view of a render window // \param renderWindow Render window object // \return Current active view // const sfView* sfRenderWindow_getView(const sfRenderWindow* renderWindow);
func (self *View) *View(RenderWindow_getView) { return C.sf*View(self.Cref, sf(*View)); }
// Get the default view of a render window // \param renderWindow Render window object // \return Default view of the render window // const sfView* sfRenderWindow_getDefaultView(const sfRenderWindow* renderWindow);
func (self *View) *View(RenderWindow_getDefaultView) { return C.sf*View(self.Cref, sf(*View)); }
// Get the viewport of a view applied to this target // \param renderWindow Render window object // \param view Target view // \return Viewport rectangle, expressed in pixels in the current target // sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view);
func (self RenderWindow) Getviewport(view *View ) IntRect { return C.sfRenderWindow_getViewport(self.Cref, sf(*View)); }
// Convert a point in window coordinates into view coordinates // \param renderWindow Render window object // \param point Point to convert, relative to the window // \param targetView Target view to convert the point to (pass NULL to use the current view) // \return The converted point, in "world" units // sfVector2f sfRenderWindow_convertCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* targetView);
func (self RenderWindow) Convertcoords(point Vector2i, targetView *View ) Vector2f { return C.sfRenderWindow_convertCoords(self.Cref, sfVector2i(point), sf(*View)); }
Draw a drawable object to the render-target \param renderWindow render window object \param object Object to draw \param states Render states to use for drawing (NULL to use the default states) void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states);
func (self RenderWindow) DrawSprite(object *Sprite , states *RenderStates ) { return C.sfRenderWindow_drawSprite(self.Cref, sf(*Sprite), sf(*RenderStates)); }
func (RenderWindow) DrawTextDefault ¶
func (self RenderWindow) DrawTextDefault(obj Text)
void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states);
func (self RenderWindow) Drawtext(object *Text , states *RenderStates ) void { return C.sfRenderWindow_drawText(self.Cref, sf(*Text), sf(*RenderStates)); }
func (RenderWindow) GetSize ¶
func (self RenderWindow) GetSize() (x, y uint)
Get the size of the rendering region of a render window \param renderWindow Render window object \return Size in pixels sfVector2u sfRenderWindow_getSize(const sfRenderWindow* renderWindow);
func (RenderWindow) IsOpen ¶
func (self RenderWindow) IsOpen() bool
Tell whether or not a render window is opened \param renderWindow Render window object sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow);
func (RenderWindow) PollEvent ¶
func (self RenderWindow) PollEvent() (interface{}, bool)
Get the event on top of events stack of a render window, if any, and pop it \param renderWindow Render window object \param event Event to fill, if any \return sfTrue if an event was returned, sfFalse if events stack was empty sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event);
func (RenderWindow) PopGLStates ¶
func (self RenderWindow) PopGLStates()
Restore the previously saved OpenGL render states and matrices See the description of pushGLStates to get a detailed description of these functions. \param renderWindow render window object void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow);
func (RenderWindow) Position ¶
func (self RenderWindow) Position() (int, int)
Get the position of a render window \param renderWindow Render window object \return Position in pixels sfVector2i sfRenderWindow_getPosition(const sfRenderWindow* renderWindow);
func (RenderWindow) PushGLStates ¶
func (self RenderWindow) PushGLStates()
Save the current OpenGL render states and matrices This function can be used when you mix SFML drawing and direct OpenGL rendering. Combined with popGLStates, it ensures that: \li SFML's internal states are not messed up by your OpenGL code \li your OpenGL states are not modified by a call to a SFML function Note that this function is quite expensive: it saves all the possible OpenGL states and matrices, even the ones you don't care about. Therefore it should be used wisely. It is provided for convenience, but the best results will be achieved if you handle OpenGL states yourself (because you know which states have really changed, and need to be saved and restored). Take a look at the resetGLStates function if you do so. \param renderWindow render window object void sfRenderWindow_pushGLStates(sfRenderWindow* renderWindow);
func (RenderWindow) ResetGLStates ¶
func (self RenderWindow) ResetGLStates()
Reset the internal OpenGL states so that the target is ready for drawing This function can be used when you mix SFML drawing and direct OpenGL rendering, if you choose not to use pushGLStates/popGLStates. It makes sure that all OpenGL states needed by SFML are set, so that subsequent sfRenderWindow_draw*() calls will work as expected. \param renderWindow render window object void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow);
func (RenderWindow) SetActive ¶
func (self RenderWindow) SetActive(active bool) bool
Activate or deactivate a render window as the current target for rendering \param renderWindow Render window object \param active sfTrue to activate, sfFalse to deactivate \return True if operation was successful, false otherwise sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active);
func (RenderWindow) SetFramerateLimit ¶
func (self RenderWindow) SetFramerateLimit(limit uint)
Limit the framerate to a maximum fixed frequency for a render window \param renderWindow Render window object \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
func (RenderWindow) SetJoystickThreshold ¶
func (self RenderWindow) SetJoystickThreshold(threshold float32)
Change the joystick threshold, ie. the value below which no move event will be generated \param renderWindow Render window object \param threshold New threshold, in range [0, 100] void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
func (RenderWindow) SetKeyRepeatEnabled ¶
func (self RenderWindow) SetKeyRepeatEnabled(enabled bool)
Enable or disable automatic key-repeat for keydown events Automatic key-repeat is enabled by default \param renderWindow Render window object \param enabled sfTrue to enable, sfFalse to disable void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled);
func (RenderWindow) SetMouseCursorVisible ¶
func (self RenderWindow) SetMouseCursorVisible(show bool)
Show or hide the mouse cursor on a render window \param renderWindow Render window object \param show sfTrue to show, sfFalse to hide void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show);
func (RenderWindow) SetPosition ¶
func (self RenderWindow) SetPosition(x, y int)
Change the position of a render window on screen Only works for top-level windows \param renderWindow Render window object \param position New position, in pixels void sfRenderWindow_setPosition(sfRenderWindow* renderWindow, sfVector2i position);
func (RenderWindow) SetSize ¶
func (self RenderWindow) SetSize(x, y uint)
Change the size of the rendering region of a render window \param renderWindow Render window object \param size New size, in pixels void sfRenderWindow_setSize(sfRenderWindow* renderWindow, sfVector2u size);
func (RenderWindow) SetTitle ¶
func (self RenderWindow) SetTitle(title string)
Change the title of a render window \param renderWindow Render window object \param title New title void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title);
func (RenderWindow) SetVerticalSyncEnabled ¶
func (self RenderWindow) SetVerticalSyncEnabled(enabled bool)
Enable / disable vertical synchronization on a render window \param renderWindow Render window object \param enabled sfTrue to enable v-sync, sfFalse to deactivate void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
func (RenderWindow) SetVisible ¶
func (self RenderWindow) SetVisible(visible bool)
Show or hide a render window \param renderWindow Render window object \param visible sfTrue to show the window, sfFalse to hide it void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible);
func (RenderWindow) Settings ¶
func (self RenderWindow) Settings() ContextSettings
Get the creation settings of a render window \param renderWindow Render window object \return Settings used to create the window sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow);
func (RenderWindow) ToWindow ¶
func (self RenderWindow) ToWindow() Window
func (RenderWindow) WaitEvent ¶
func (self RenderWindow) WaitEvent(event Event) bool
Wait for an event and return it \param renderWindow Render window object \param event Event to fill \return sfFalse if an error occured sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event);
type Shader ¶
func NewShaderFromFile ¶
\brief Load both the vertex and fragment shaders from files This function can load both the vertex and the fragment shaders, or only one of them: pass NULL if you don't want to load either the vertex shader or the fragment shader. The sources must be text files containing valid shaders in GLSL language. GLSL is a C-like language dedicated to OpenGL shaders; you'll probably need to read a good documentation for it before writing your own shaders. \param vertexShaderFilename Path of the vertex shader file to load, or NULL to skip this shader \param fragmentShaderFilename Path of the fragment shader file to load, or NULL to skip this shader \return A new sfShader object, or NULL if it failed sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename);
func (Shader) Bind ¶
func (self Shader) Bind()
\brief Bind a shader for rendering (activate it) This function is normally for internal use only, unless you want to use the shader with a custom OpenGL rendering instead of a SFML drawable. \code sfWindow_setActive(window, sfTrue); sfShader_bind(shader); ... render OpenGL geometry ... sfShader_unbind(shader); \endcode \param shader Shader to bind void sfShader_bind(const sfShader* shader);
func (Shader) Destroy ¶
func (self Shader) Destroy()
\brief Destroy an existing shader \param shader Shader to delete void sfShader_destroy(sfShader* shader);
func (Shader) IsAvailable ¶
\brief Tell whether or not the system supports shaders This function should always be called before using the shader features. If it returns false, then any attempt to use sfShader will fail. \return sfTrue if the system can use shaders, sfFalse otherwise sfBool sfShader_isAvailable(void);
func (Shader) SetColorParameter ¶
\brief Change a color parameter of a shader \a name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x1 vector (vec4 GLSL type). It is important to note that the components of the color are normalized before being passed to the shader. Therefore, they are converted from range [0 .. 255] to range [0 .. 1]. For example, a sf::Color(255, 125, 0, 255) will be transformed to a vec4(1.0, 0.5, 0.0, 1.0) in the shader. Example: \code uniform vec4 color; // this is the variable in the shader \endcode \code sfShader_setColorParameter(shader, "color", sfColor_FromRGB(255, 128, 0)); \endcode \param shader Shader object \param name Name of the parameter in the shader \param color Color to assign void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
func (Shader) SetCurrentTextureParameter ¶
\brief Change a texture parameter of a shader This function maps a shader texture variable to the texture of the object being drawn, which cannot be known in advance. The corresponding parameter in the shader must be a 2D texture (sampler2D GLSL type). Example: \code uniform sampler2D current; // this is the variable in the shader \endcode \code sfShader_setCurrentTextureParameter(shader, "current"); \endcode \param shader Shader object \param name Name of the texture in the shader void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
func (Shader) SetFloat2Parameter ¶
\brief Change a 2-components vector parameter of a shader \a name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 2x1 vector (vec2 GLSL type). Example: \code uniform vec2 myparam; // this is the variable in the shader \endcode \code sfShader_setFloat2Parameter(shader, "myparam", 5.2f, 6.0f); \endcode \param shader Shader object \param name Name of the parameter in the shader \param x First component of the value to assign \param y Second component of the value to assign void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
func (Shader) SetFloat3Parameter ¶
\brief Change a 3-components vector parameter of a shader \a name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 3x1 vector (vec3 GLSL type). Example: \code uniform vec3 myparam; // this is the variable in the shader \endcode \code sfShader_setFloat3Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f); \endcode \param shader Shader object \param name Name of the parameter in the shader \param x First component of the value to assign \param y Second component of the value to assign \param z Third component of the value to assign void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
func (Shader) SetFloatParameter ¶
\brief Change a float parameter of a shader \a name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a float (float GLSL type). Example: \code uniform float myparam; // this is the variable in the shader \endcode \code sfShader_setFloatParameter(shader, "myparam", 5.2f); \endcode \param shader Shader object \param name Name of the parameter in the shader \param x Value to assign void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
func (Shader) SetTextureParameter ¶
\brief Change a texture parameter of a shader \a name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 2D texture (sampler2D GLSL type). Example: \code uniform sampler2D the_texture; // this is the variable in the shader \endcode \code sf::Texture texture; ... sfShader_setTextureParameter(shader, "the_texture", texture); \endcode It is important to note that \a texture must remain alive as long as the shader uses it, no copy is made internally. To use the texture of the object being draw, which cannot be known in advance, you can use the special function sfShader_setCurrentTextureParameter: \code sfShader_setCurrentTextureParameter(shader, "the_texture"). \endcode \param shader Shader object \param name Name of the texture in the shader \param texture Texture to assign void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
func (Shader) SetTransformParameter ¶
\brief Change a matrix parameter of a shader \a name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x4 matrix (mat4 GLSL type). Example: \code uniform mat4 matrix; // this is the variable in the shader \endcode \code @todo sfShader_setTransformParameter(shader, "matrix", transform); \endcode \param shader Shader object \param name Name of the parameter in the shader \param transform Transform to assign void sfShader_setTransformParameter(sfShader* shader, const char* name, const sfTransform* transform);
func (Shader) SetVector2Parameter ¶
\brief Change a 2-components vector parameter of a shader \a name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 2x1 vector (vec2 GLSL type). Example: \code uniform vec2 myparam; // this is the variable in the shader \endcode \code sfVector2f vec = {5.2f, 6.0f}; sfShader_setVector2Parameter(shader, "myparam", vec); \endcode \param shader Shader object \param name Name of the parameter in the shader \param vector Vector to assign void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
func (Shader) SetVector3parameter ¶
\brief Change a 3-components vector parameter of a shader \a name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 3x1 vector (vec3 GLSL type). Example: \code uniform vec3 myparam; // this is the variable in the shader \endcode \code sfVector3f vec = {5.2f, 6.0f, -8.1f}; sfShader_setVector3Parameter(shader, "myparam", vec); \endcode \param shader Shader object \param name Name of the parameter in the shader \param vector Vector to assign void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
func (Shader) Setfloat4parameter ¶
\brief Change a 4-components vector parameter of a shader \a name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x1 vector (vec4 GLSL type). Example: \code uniform vec4 myparam; // this is the variable in the shader \endcode \code sfShader_setFloat4Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f, 0.4f); \endcode \param shader Shader object \param name Name of the parameter in the shader \param x First component of the value to assign \param y Second component of the value to assign \param z Third component of the value to assign \param w Fourth component of the value to assign void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
type SizeEvent ¶
type SizeEvent struct { Type EventType Cref *C.sfSizeEvent }
////////////////////////////////////////////////////////// / \brief Size events parameters / ////////////////////////////////////////////////////////// struct sfSizeEvent
{ sfEventType type; unsigned int width; unsigned int height; };
type Sound ¶
func (Sound) Copy ¶
\brief Create a new sound by copying an existing one \param sound Sound to copy \return A new sfSound object which is a copy of \a sound sfSound* sfSound_copy(sfSound* sound);
func (Sound) Destroy ¶
func (self Sound) Destroy()
\brief Destroy a sound \param sound Sound to destroy void sfSound_destroy(sfSound* sound);
func (Sound) GetAttenuation ¶
\brief Get the attenuation factor of a sound \param sound Sound object \return Attenuation factor of the sound float sfSound_getAttenuation(const sfSound* sound);
func (Sound) GetLoop ¶
\brief Tell whether or not a soud is in loop mode \param sound Sound object \return sfTrue if the sound is looping, sfFalse otherwise sfBool sfSound_getLoop(const sfSound* sound);
func (Sound) GetPlayingOffset ¶
\brief Get the current playing position of a sound \param sound Sound object \return Current playing position sfTime sfSound_getPlayingOffset(const sfSound* sound);
func (Sound) GetVolume ¶
\brief Get the volume of a sound \param sound Sound object \return Volume of the sound, in the range [0, 100] float sfSound_getVolume(const sfSound* sound);
func (Sound) Getmindistance ¶
\brief Get the minimum distance of a sound \param sound Sound object \return Minimum distance of the sound float sfSound_getMinDistance(const sfSound* sound);
func (Sound) Getpitch ¶
\brief Get the pitch of a sound \param sound Sound object \return Pitch of the sound float sfSound_getPitch(const sfSound* sound);
func (Sound) Getposition ¶
\brief Get the 3D position of a sound in the audio scene \param sound Sound object \return Position of the sound in the world sfVector3f sfSound_getPosition(const sfSound* sound);
func (Sound) Getstatus ¶
func (self Sound) Getstatus() SoundStatus
\brief Get the current status of a sound (stopped, paused, playing) \param sound Sound object \return Current status sfSoundStatus sfSound_getStatus(const sfSound* sound);
func (Sound) IsRelativeToListener ¶
\brief Tell whether a sound's position is relative to the
listener or is absolute
\param sound Sound object \return sfTrue if the position is relative, sfFalse if it's absolute sfBool sfSound_isRelativeToListener(const sfSound* sound);
func (Sound) NewSound ¶
\brief Create a new sound \return A new sfSound object sfSound* sfSound_create(void);
func (Sound) Pause ¶
func (self Sound) Pause()
\brief Pause a sound This function pauses the sound if it was playing, otherwise (sound already paused or stopped) it has no effect. \param sound Sound object void sfSound_pause(sfSound* sound);
func (Sound) Play ¶
func (self Sound) Play()
\brief Start or resume playing a sound This function starts the sound if it was stopped, resumes it if it was paused, and restarts it from beginning if it was it already playing.// This function uses its own thread so that it doesn't block the rest of the program while the sound is played. \param sound Sound object void sfSound_play(sfSound* sound);
func (Sound) SetLoop ¶
\brief Set whether or not a sound should loop after reaching the end If set, the sound will restart from beginning after reaching the end and so on, until it is stopped or sfSound_setLoop(sound, sfFalse) is called. The default looping state for sounds is false. \param sound Sound object \param loop sfTrue to play in loop, sfFalse to play once void sfSound_setLoop(sfSound* sound, sfBool loop);
func (Sound) SetMinDistance ¶
\brief Set the minimum distance of a sound The "minimum distance" of a sound is the maximum distance at which it is heard at its maximum volume. Further than the minimum distance, it will start to fade out according to its attenuation factor. A value of 0 ("inside the head of the listener") is an invalid value and is forbidden. The default value of the minimum distance is 1. \param sound Sound object \param distance New minimum distance of the sound void sfSound_setMinDistance(sfSound* sound, float distance);
func (Sound) SetPitch ¶
\brief Set the pitch of a sound The pitch represents the perceived fundamental frequency of a sound; thus you can make a sound more acute or grave by changing its pitch. A side effect of changing the pitch is to modify the playing speed of the sound as well. The default value for the pitch is 1. \param sound Sound object \param pitch New pitch to apply to the sound void sfSound_setPitch(sfSound* sound, float pitch);
func (Sound) SetPlayingOffset ¶
\brief Change the current playing position of a sound The playing position can be changed when the sound is either paused or playing. \param sound Sound object \param timeOffset New playing position void sfSound_setPlayingOffset(sfSound* sound, sfTime timeOffset);
func (Sound) SetPosition ¶
\brief Set the 3D position of a sound in the audio scene Only sounds with one channel (mono sounds) can be spatialized. The default position of a sound is (0, 0, 0). \param sound Sound object \param position Position of the sound in the scene void sfSound_setPosition(sfSound* sound, sfVector3f position);
func (Sound) SetVolume ¶
\brief Set the volume of a sound The volume is a value between 0 (mute) and 100 (full volume). The default value for the volume is 100. \param sound Sound object \param volume Volume of the sound void sfSound_setVolume(sfSound* sound, float volume);
func (Sound) Setattenuation ¶
type SoundBuffer ¶
type SoundBuffer struct {
Cref *C.sfSoundBuffer
}
func SoundBufferFromFile ¶
func SoundBufferFromFile(filename string) SoundBuffer
\brief Create a new sound buffer and load it from a file Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64. \param filename Path of the sound file to load \return A new sfSoundBuffer object (NULL if failed) sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename);
func (SoundBuffer) Copy ¶
func (self SoundBuffer) Copy() SoundBuffer
\brief Create a new sound buffer by copying an existing one \param soundBuffer Sound buffer to copy \return A new sfSoundBuffer object which is a copy of \a soundBuffer sfSoundBuffer* sfSoundBuffer_copy(sfSoundBuffer* soundBuffer);
func (SoundBuffer) Destroy ¶
func (self SoundBuffer) Destroy()
\brief Destroy a sound buffer \param soundBuffer Sound buffer to destroy void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer);
func (SoundBuffer) GetChannelCount ¶
func (self SoundBuffer) GetChannelCount() uint
\brief Get the number of channels used by a sound buffer If the sound is mono then the number of channels will be 1, 2 for stereo, etc. \param soundBuffer Sound buffer object \return Number of channels unsigned int sfSoundBuffer_getChannelCount(const sfSoundBuffer* soundBuffer);
func (SoundBuffer) GetSampleCount ¶
func (self SoundBuffer) GetSampleCount() C.size_t
TODO Verify how to handle size_t in this context. \brief Get the number of samples stored in a sound buffer The array of samples can be accessed with the sfSoundBuffer_getSamples function. \param soundBuffer Sound buffer object \return Number of samples size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer);
func (SoundBuffer) GetSampleRate ¶
func (self SoundBuffer) GetSampleRate() uint
\brief Get the sample rate of a sound buffer The sample rate is the number of samples played per second. The higher, the better the quality (for example, 44100 samples/s is CD quality). \param soundBuffer Sound buffer object \return Sample rate (number of samples per second) unsigned int sfSoundBuffer_getSampleRate(const sfSoundBuffer* soundBuffer);
func (SoundBuffer) Getduration ¶
func (self SoundBuffer) Getduration() Time
\brief Get the total duration of a sound buffer \param soundBuffer Sound buffer object \return Sound duration sfTime sfSoundBuffer_getDuration(const sfSoundBuffer* soundBuffer);
func (SoundBuffer) SaveToFile ¶
func (self SoundBuffer) SaveToFile(filename string) bool
\brief Save a sound buffer to an audio file Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64. \param soundBuffer Sound buffer object \param filename Path of the sound file to write \return sfTrue if saving succeeded, sfFalse if it failed sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename);
type SoundBufferRecorder ¶
type SoundBufferRecorder struct {
Cref *C.sfSoundBufferRecorder
}
func NewSoundBufferRecorder ¶
func NewSoundBufferRecorder() SoundBufferRecorder
\brief Create a new sound buffer recorder \return A new sfSoundBufferRecorder object (NULL if failed) sfSoundBufferRecorder* sfSoundBufferRecorder_create(void);
func (SoundBufferRecorder) Destroy ¶
func (self SoundBufferRecorder) Destroy()
\brief Destroy a sound buffer recorder \param soundBufferRecorder Sound buffer recorder to destroy void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder);
func (SoundBufferRecorder) GetBuffer ¶
func (self SoundBufferRecorder) GetBuffer() SoundBuffer
\brief Get the sound buffer containing the captured audio data The sound buffer is valid only after the capture has ended. This function provides a read-only access to the internal sound buffer, but it can be copied if you need to make any modification to it. \param soundBufferRecorder Sound buffer recorder object \return Read-only access to the sound buffer const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder* soundBufferRecorder);
func (SoundBufferRecorder) GetSampleRate ¶
func (self SoundBufferRecorder) GetSampleRate() uint
\brief Get the sample rate of a sound buffer recorder The sample rate defines the number of audio samples captured per second. The higher, the better the quality (for example, 44100 samples/sec is CD quality). \param soundBufferRecorder Sound buffer recorder object \return Sample rate, in samples per second unsigned int sfSoundBufferRecorder_getSampleRate(const sfSoundBufferRecorder* soundBufferRecorder);
func (SoundBufferRecorder) Start ¶
func (self SoundBufferRecorder) Start(sampleRate uint)
\brief Start the capture of a sound recorder recorder The \a sampleRate parameter defines the number of audio samples captured per second. The higher, the better the quality (for example, 44100 samples/sec is CD quality). This function uses its own thread so that it doesn't block the rest of the program while the capture runs. Please note that only one capture can happen at the same time. \param soundBufferRecorder Sound buffer recorder object \param sampleRate Desired capture rate, in number of samples per second void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
func (SoundBufferRecorder) Stop ¶
func (self SoundBufferRecorder) Stop()
\brief Stop the capture of a sound recorder \param soundBufferRecorder Sound buffer recorder object void sfSoundBufferRecorder_stop(sfSoundBufferRecorder* soundBufferRecorder);
type SoundStatus ¶
type SoundStatus uint
const ( Stopped SoundStatus = iota // Sound / music is not playing Paused // Sound / music is paused Playing // Sound / music is playing UnknownSoundStatus )
type Sprite ¶
func NewSprite ¶
Create a new sprite \return A new sfSprite object, or NULL if it failed sfSprite* sfSprite_create(void);
func (Sprite) Color ¶
Get the global color of a sprite \param sprite Sprite object \return Global color of the sprite sfColor sfSprite_getColor(const sfSprite* sprite);
func (Sprite) Copy ¶
Copy an existing sprite \param sprite Sprite to copy \return Copied object sfSprite* sfSprite_copy(sfSprite* sprite);
func (Sprite) Destroy ¶
func (self Sprite) Destroy()
Destroy an existing sprite \param sprite Sprite to delete void sfSprite_destroy(sfSprite* sprite);
func (Sprite) GetScale ¶
Get the current scale of a sprite \param sprite Sprite object \return Current scale factors sfVector2f sfSprite_getScale(const sfSprite* sprite);
func (Sprite) GlobalBounds ¶
Get the global bounding rectangle of a sprite The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system. \param sprite Sprite object \return Global bounding rectangle of the entity sfFloatRect sfSprite_getGlobalBounds(const sfSprite* sprite);
func (Sprite) InverseTransform ¶
Get the inverse of the combined transform of a sprite \param sprite Sprite object \return Inverse of the combined transformations applied to the object const sfTransform* sfSprite_getInverseTransform(const sfSprite* sprite);
func (Sprite) LocalBounds ¶
Get the local bounding rectangle of a sprite The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system. \param sprite Sprite object \return Local bounding rectangle of the entity sfFloatRect sfSprite_getLocalBounds(const sfSprite* sprite);
func (Sprite) Move ¶
Move a sprite by a given offset This function adds to the current position of the object, unlike sfSprite_setPosition which overwrites it. \param sprite Sprite object \param offset Offset void sfSprite_move(sfSprite* sprite, sfVector2f offset);
func (Sprite) Origin ¶
Get the local origin of a sprite \param sprite Sprite object \return Current origin sfVector2f sfSprite_getOrigin(const sfSprite* sprite);
func (Sprite) Position ¶
Get the position of a sprite \param sprite Sprite object \return Current position sfVector2f sfSprite_getPosition(const sfSprite* sprite);
func (Sprite) Rotate ¶
Rotate a sprite This function adds to the current rotation of the object, unlike sfSprite_setRotation which overwrites it. \param sprite Sprite object \param angle Angle of rotation, in degrees void sfSprite_rotate(sfSprite* sprite, float angle);
func (Sprite) Rotation ¶
Get the orientation of a sprite The rotation is always in the range [0, 360]. \param sprite Sprite object \return Current rotation, in degrees float sfSprite_getRotation(const sfSprite* sprite);
func (Sprite) Scale ¶
Scale a sprite This function multiplies the current scale of the object, unlike sfSprite_setScale which overwrites it. \param sprite Sprite object \param factors Scale factors void sfSprite_scale(sfSprite* sprite, sfVector2f factors);
func (Sprite) SetColor ¶
Set the global color of a sprite This color is modulated (multiplied) with the sprite's texture. It can be used to colorize the sprite, or change its global opacity. By default, the sprite's color is opaque white. \param sprite Sprite object \param color New color of the sprite void sfSprite_setColor(sfSprite* sprite, sfColor color);
func (Sprite) SetOrigin ¶
Set the local origin of a sprite The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a sprite Sprite object is (0, 0). \param sprite Sprite object \param origin New origin void sfSprite_setOrigin(sfSprite* sprite, sfVector2f origin);
func (Sprite) SetPosition ¶
Set the position of a sprite This function completely overwrites the previous position. See sfSprite_move to apply an offset based on the previous position instead. The default position of a sprite Sprite object is (0, 0). \param sprite Sprite object \param position New position void sfSprite_setPosition(sfSprite* sprite, sfVector2f position);
func (Sprite) SetRotation ¶
Set the orientation of a sprite This function completely overwrites the previous rotation. See sfSprite_rotate to add an angle based on the previous rotation instead. The default rotation of a sprite Sprite object is 0. \param sprite Sprite object \param angle New rotation, in degrees void sfSprite_setRotation(sfSprite* sprite, float angle);
func (Sprite) SetScale ¶
Set the scale factors of a sprite This function completely overwrites the previous scale. See sfSprite_scale to add a factor based on the previous scale instead. The default scale of a sprite Sprite object is (1, 1). \param sprite Sprite object \param scale New scale factors void sfSprite_setScale(sfSprite* sprite, sfVector2f scale);
func (Sprite) SetTexture ¶
Change the source texture of a sprite The \a texture argument refers to a texture that must exist as long as the sprite uses it. Indeed, the sprite doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the sprite tries to use it, the behaviour is undefined. If \a resetRect is true, the TextureRect property of the sprite is automatically adjusted to the size of the new texture. If it is false, the texture rect is left unchanged. \param sprite Sprite object \param texture New texture \param resetRect Should the texture rect be reset to the size of the new texture? void sfSprite_setTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect);
func (Sprite) SetTextureRect ¶
Set the sub-rectangle of the texture that a sprite will display The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture. \param sprite Sprite object \param rectangle Rectangle defining the region of the texture to display void sfSprite_setTextureRect(sfSprite* sprite, sfIntRect rectangle);
func (Sprite) Texture ¶
Get the source texture of a sprite If the sprite has no source texture, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the texture when you retrieve it with this function. \param sprite Sprite object \return Pointer to the sprite's texture const sfTexture* sfSprite_getTexture(const sfSprite* sprite);
func (Sprite) TextureRect ¶
Get the sub-rectangle of the texture displayed by a sprite \param sprite Sprite object \return Texture rectangle of the sprite sfIntRect sfSprite_getTextureRect(const sfSprite* sprite);
type Text ¶
func NewText ¶
sfText styles Create a new text \return A new sfText object, or NULL if it failed sfText* sfText_create(void);
func (Text) CharacterSize ¶
Get the size of the characters of a text \param text Text object \return Size of the characters unsigned int sfText_getCharacterSize(const sfText* text);
func (Text) Color ¶
Get the global color of a text \param text Text object \return Global color of the text sfColor sfText_getColor(const sfText* text);
func (Text) Copy ¶
Copy an existing text \param text Text to copy \return Copied object sfText* sfText_copy(sfText* text);
func (Text) Destroy ¶
func (self Text) Destroy()
Destroy an existing text \param text Text to delete void sfText_destroy(sfText* text);
func (Text) FindCharacterPos ¶
Return the position of the \a index-th character in a text This function computes the visual position of a character from its index in the string. The returned position is in global coordinates (translation, rotation, scale and origin are applied). If \a index is out of range, the position of the end of the string is returned. \param text Text object \param index Index of the character \return Position of the character sfVector2f sfText_findCharacterPos(const sfText* text, size_t index);
func (Text) Font ¶
Get the font used by a text \param text Text object \return Pointer to the font const sfFont* sfText_getFont(const sfText* text);
func (Text) GetScale ¶
Get the current scale of a text \param text Text object \return Current scale factors sfVector2f sfText_getScale(const sfText* text);
func (Text) GlobalBounds ¶
Get the global bounding rectangle of a text The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the text in the global 2D world's coordinate system. \param text Text object \return Global bounding rectangle of the entity sfFloatRect sfText_getGlobalBounds(const sfText* text);
func (Text) InverseTransform ¶
Get the inverse of the combined transform of a text \param text Text object \return Inverse of the combined transformations applied to the object const sfTransform* sfText_getInverseTransform(const sfText* text);
func (Text) LocalBounds ¶
Get the local bounding rectangle of a text The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system. \param text Text object \return Local bounding rectangle of the entity sfFloatRect sfText_getLocalBounds(const sfText* text);
func (Text) Move ¶
Move a text by a given offset This function adds to the current position of the object, unlike sfText_setPosition which overwrites it. \param text Text object \param offset Offset void sfText_move(sfText* text, sfVector2f offset);
func (Text) Origin ¶
Get the local origin of a text \param text Text object \return Current origin sfVector2f sfText_getOrigin(const sfText* text);
func (Text) Position ¶
Get the position of a text \param text Text object \return Current position sfVector2f sfText_getPosition(const sfText* text);
func (Text) Rotate ¶
Rotate a text This function adds to the current rotation of the object, unlike sfText_setRotation which overwrites it. \param text Text object \param angle Angle of rotation, in degrees void sfText_rotate(sfText* text, float angle);
func (Text) Rotation ¶
Get the orientation of a text The rotation is always in the range [0, 360]. \param text Text object \return Current rotation, in degrees float sfText_getRotation(const sfText* text);
func (Text) Scale ¶
Scale a text This function multiplies the current scale of the object, unlike sfText_setScale which overwrites it. \param text Text object \param factors Scale factors void sfText_scale(sfText* text, sfVector2f factors);
func (Text) SetCharacterSize ¶
Set the character size of a text The default size is 30. \param text Text object \param size New character size, in pixels void sfText_setCharacterSize(sfText* text, unsigned int size);
func (Text) SetColor ¶
Set the global color of a text By default, the text's color is opaque white. \param text Text object \param color New color of the text void sfText_setColor(sfText* text, sfColor color);
func (Text) SetFont ¶
Set the font of a text The \a font argument refers to a texture that must exist as long as the text uses it. Indeed, the text doesn't store its own copy of the font, but rather keeps a pointer to the one that you passed to this function. If the font is destroyed and the text tries to use it, the behaviour is undefined. Texts have a valid font by default, which the built-in sfFont_getDefaultFont(). \param text Text object \param font New font void sfText_setFont(sfText* text, const sfFont* font);
func (Text) SetOrigin ¶
Set the local origin of a text The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a text object is (0, 0). \param text Text object \param origin New origin void sfText_setOrigin(sfText* text, sfVector2f origin);
func (Text) SetPosition ¶
Set the position of a text This function completely overwrites the previous position. See sfText_move to apply an offset based on the previous position instead. The default position of a text Text object is (0, 0). \param text Text object \param position New position void sfText_setPosition(sfText* text, sfVector2f position);
func (Text) SetRotation ¶
Set the orientation of a text This function completely overwrites the previous rotation. See sfText_rotate to add an angle based on the previous rotation instead. The default rotation of a text Text object is 0. \param text Text object \param angle New rotation, in degrees void sfText_setRotation(sfText* text, float angle);
func (Text) SetScale ¶
Set the scale factors of a text This function completely overwrites the previous scale. See sfText_scale to add a factor based on the previous scale instead. The default scale of a text Text object is (1, 1). \param text Text object \param scale New scale factors void sfText_setScale(sfText* text, sfVector2f scale);
func (Text) SetString ¶
Set the string of a text (from an ANSI string) A text's string is empty by default. \param text Text object \param string New string void sfText_setString(sfText* text, const char* string);
func (Text) SetStyle ¶
Set the style of a text You can pass a combination of one or more styles, for example sfTextBold | sfTextItalic. The default style is sfTextRegular. \param text Text object \param style New style void sfText_setStyle(sfText* text, sfUint32 style);
func (Text) SetUnicodeString ¶
Set the string of a text (from a unicode string) \param text Text object \param string New string void sfText_setUnicodeString(sfText* text, const sfUint32* string);
func (Text) String ¶
Get the text of a text (returns an ANSI string) \param text Text object \return String an a locale-dependant ANSI string const char* sfText_getString(const sfText* text);
func (Text) Style ¶
Get the style of a text \param text Text object \return Current string style (see sfTextStyle enum) sfUint32 sfText_getStyle(const sfText* text);
func (Text) Transform ¶
Get the combined transform of a text \param text Text object \return Transform combining the position/rotation/scale/origin of the object const sfTransform* sfText_getTransform(const sfText* text);
func (Text) UnicodeString ¶
Get the string of a text (returns a unicode string) \param text Text object \return String as UTF-32 const sfUint32* sfText_getUnicodeString(const sfText* text);
type TextEvent ¶
type TextEvent struct { Type EventType Cref *C.sfTextEvent }
////////////////////////////////////////////////////////// / \brief Text event parameters / ////////////////////////////////////////////////////////// struct sfTextEvent
{ sfEventType type; sfUint32 unicode; };
type Texture ¶
func NewTexture ¶
\brief Create a new texture \param width Texture width \param height Texture height \return A new sfTexture object, or NULL if it failed sfTexture* sfTexture_create(unsigned int width, unsigned int height);
func TextureFromFile ¶
\brief Create a new texture from a file \param filename Path of the image file to load \param area Area of the source image to load (NULL to load the entire image) \return A new sfTexture object, or NULL if it failed sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area);
func TextureFromImageRect ¶
\brief Create a new texture from an image \param image Image to upload to the texture \param area Area of the source image to load (NULL to load the entire image) \return A new sfTexture object, or NULL if it failed sfTexture* sfTexture_createFromImage(const sfImage* image, const sfIntRect* area);
func TextureFromImageWhole ¶
func (Texture) Bind ¶
func (self Texture) Bind()
\brief Activate a texture for rendering \param texture Texture to bind void sfTexture_bind(const sfTexture* texture);
func (Texture) Copy ¶
\brief Copy an existing texture \param texture Texture to copy \return Copied object sfTexture* sfTexture_copy(sfTexture* texture);
func (Texture) CopyToImage ¶
\brief Copy a texture's pixels to an image \param texture Texture to copy \return Image containing the texture's pixels sfImage* sfTexture_copyToImage(const sfTexture* texture);
func (Texture) Destroy ¶
func (self Texture) Destroy()
\brief Destroy an existing texture \param texture Texture to delete void sfTexture_destroy(sfTexture* texture);
func (Texture) IsRepeated ¶
\brief Tell whether a texture is repeated or not \param texture The texture object \return sfTrue if repeat mode is enabled, sfFalse if it is disabled sfBool sfTexture_isRepeated(const sfTexture* texture);
func (Texture) IsSmooth ¶
\brief Tell whether the smooth filter is enabled or not for a texture \param texture The texture object \return sfTrue if smoothing is enabled, sfFalse if it is disabled sfBool sfTexture_isSmooth(const sfTexture* texture);
func (Texture) SetRepeated ¶
\brief Enable or disable repeating for a texture Repeating is involved when using texture coordinates outside the texture rectangle [0, 0, width, height]. In this case, if repeat mode is enabled, the whole texture will be repeated as many times as needed to reach the coordinate (for example, if the X texture coordinate is 3 * width, the texture will be repeated 3 times). If repeat mode is disabled, the "extra space" will instead be filled with border pixels. Warning: on very old graphics cards, white pixels may appear when the texture is repeated. With such cards, repeat mode can be used reliably only if the texture has power-of-two dimensions (such as 256x128). Repeating is disabled by default. \param texture The texture object \param repeated True to repeat the texture, false to disable repeating void sfTexture_setRepeated(sfTexture* texture, sfBool repeated);
func (Texture) SetSmooth ¶
\brief Enable or disable the smooth filter on a texture \param texture The texture object \param smooth sfTrue to enable smoothing, sfFalse to disable it void sfTexture_setSmooth(sfTexture* texture, sfBool smooth);
func (Texture) Size ¶
\brief Return the size of the texture \param texture Texture to read \return Size in pixels sfVector2u sfTexture_getSize(const sfTexture* texture);
func (Texture) UpdateFromImage ¶
\brief Update a texture from an image \param texture Texture to update \param image Image to copy to the texture \param x X offset in the texture where to copy the source pixels \param y Y offset in the texture where to copy the source pixels void sfTexture_updateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y);
func (Texture) UpdateFromPixels ¶
\brief Update a texture from an array of pixels \param texture Texture to update \param pixels Array of pixels to copy to the texture \param width Width of the pixel region contained in \a pixels \param height Height of the pixel region contained in \a pixels \param x X offset in the texture where to copy the source pixels \param y Y offset in the texture where to copy the source pixels void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y);
func (Texture) UpdateFromRenderWindow ¶
func (self Texture) UpdateFromRenderWindow(win RenderWindow, x, y uint)
\brief Update a texture from the contents of a render-window \param texture Texture to update \param renderWindow Render-window to copy to the texture \param x X offset in the texture where to copy the source pixels \param y Y offset in the texture where to copy the source pixels void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
func (Texture) UpdateFromWindow ¶
\brief Update a texture from the contents of a window \param texture Texture to update \param window Window to copy to the texture \param x X offset in the texture where to copy the source pixels \param y Y offset in the texture where to copy the source pixels void sfTexture_updateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y);
type Time ¶
func Microseconds ¶
func Milliseconds ¶
func (Time) AsMicroseconds ¶
func (Time) AsMilliseconds ¶
type Transform ¶
type Transform struct {
Cref *C.sfTransform
}
func (Transform) Combine ¶
\brief Combine two transforms The result is a transform that is equivalent to applying \a transform followed by \a other. Mathematically, it is equivalent to a matrix multiplication. \param transform Transform object \param right Transform to combine to \a transform void sfTransform_combine(sfTransform* transform, const sfTransform* other);
func (Transform) GetInverse ¶
\brief Return the inverse of a transform
If the inverse cannot be computed, a new identity transform is returned.
\param transform Transform object \return The inverse matrix CSFML_GRAPHICS_API sfTransform sfTransform_getInverse(const sfTransform* transform);
func (Transform) GetMatrix ¶
\brief Return the 4x4 matrix of a transform
This function fills an array of 16 floats with the transform converted as a 4x4 matrix, which is directly compatible with OpenGL functions.
\code sfTransform transform = ...; float matrix[16]; sfTransform_getMatrix(&transform, matrix) glLoadMatrixf(matrix); \endcode
\param transform Transform object \param matrix Pointer to the 16-element array to fill with the matrix
///////////////////////////////////////////////////////// CSFML_GRAPHICS_API void sfTransform_getMatrix(const sfTransform* transform, float* matrix);
func (Transform) Rotate ¶
\brief Combine the current transform with a rotation \param transform Transform object \param angle Rotation angle, in degrees void sfTransform_rotate(sfTransform* transform, float angle);
func (Transform) RotateWithCenter ¶
\brief Combine the current transform with a rotation The center of rotation is provided for convenience as a second argument, so that you can build rotations around arbitrary points more easily (and efficiently) than the usual [translate(-center), rotate(angle), translate(center)]. \param transform Transform object \param angle Rotation angle, in degrees \param centerX X coordinate of the center of rotation \param centerY Y coordinate of the center of rotation void sfTransform_rotateWithCenter(sfTransform* transform, float angle, float centerX, float centerY);
func (Transform) Scale ¶
\brief Combine the current transform with a scaling \param transform Transform object \param scaleX Scaling factor on the X axis \param scaleY Scaling factor on the Y axis void sfTransform_scale(sfTransform* transform, float scaleX, float scaleY);
func (Transform) ScaleWithCenter ¶
\brief Combine the current transform with a scaling The center of scaling is provided for convenience as a second argument, so that you can build scaling around arbitrary points more easily (and efficiently) than the usual [translate(-center), scale(factors), translate(center)] \param transform Transform object \param scaleX Scaling factor on X axis \param scaleY Scaling factor on Y axis \param centerX X coordinate of the center of scaling \param centerY Y coordinate of the center of scaling void sfTransform_scaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY);
func (Transform) TransformPoint ¶
\brief Apply a transform to a 2D point \param transform Transform object \param point Point to transform \return Transformed point sfVector2f sfTransform_transformPoint(const sfTransform* transform, sfVector2f point);
func (Transform) TransformRect ¶
\brief Apply a transform to a rectangle Since SFML doesn't provide support for oriented rectangles, the result of this function is always an axis-aligned rectangle. Which means that if the transform contains a rotation, the bounding rectangle of the transformed rectangle is returned. \param transform Transform object \param rectangle Rectangle to transform \return Transformed rectangle sfFloatRect sfTransform_transformRect(const sfTransform* transform, sfFloatRect rectangle);
type Vector3f ¶
type Vector3f struct {
Cref C.sfVector3f
}
func GetDirection ¶
func GetDirection() Vector3f
\brief Get the current orientation of the listener in the scene \return The listener's direction sfVector3f sfListener_getDirection();
func GetPosition ¶
func GetPosition() Vector3f
\brief Get the current position of the listener in the scene \return The listener's position sfVector3f sfListener_getPosition();
func NewVector3f ¶
type Vertex ¶
func (Vertex) GetPosition ¶
func (Vertex) GetTexCoords ¶
func (Vertex) SetPosition ¶
func (Vertex) SetTexCoords ¶
type VertexArray ¶
type VertexArray struct {
Cref *C.sfVertexArray
}
func NewVertexArray ¶
func NewVertexArray() VertexArray
\brief Create a new vertex array \return A new sfVertexArray object sfVertexArray* sfVertexArray_create(void);
func (VertexArray) Append ¶
func (self VertexArray) Append(vertex Vertex)
\brief Add a vertex to a vertex array array \param vertexArray Vertex array objet \param vertex Vertex to add void sfVertexArray_append(sfVertexArray* vertexArray, sfVertex vertex);
func (VertexArray) Clear ¶
func (self VertexArray) Clear()
\brief Clear a vertex array This function removes all the vertices from the array. It doesn't deallocate the corresponding memory, so that adding new vertices after clearing doesn't involve reallocating all the memory. \param vertexArray Vertex array object void sfVertexArray_clear(sfVertexArray* vertexArray);
func (VertexArray) Copy ¶
func (self VertexArray) Copy() VertexArray
\brief Copy an existing vertex array \param vertexArray Vertex array to copy \return Copied object sfVertexArray* sfVertexArray_copy(sfVertexArray* vertexArray);
func (VertexArray) Destroy ¶
func (self VertexArray) Destroy()
\brief Destroy an existing vertex array \param vertexArray Vertex array to delete void sfVertexArray_destroy(sfVertexArray* vertexArray);
func (VertexArray) GetVertex ¶
func (self VertexArray) GetVertex(index uint) Vertex
\brief Get access to a vertex by its index This function doesn't check \a index, it must be in range [0, vertex count - 1]. The behaviour is undefined otherwise. \param vertexArray Vertex array object \param index Index of the vertex to get \return Pointer to the index-th vertex sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, unsigned int index);
func (VertexArray) GetVertexCount ¶
func (self VertexArray) GetVertexCount() uint
\brief Return the vertex count of a vertex array \param vertexArray Vertex array object \return Number of vertices in the array unsigned int sfVertexArray_getVertexCount(const sfVertexArray* vertexArray);
func (VertexArray) Getbounds ¶
func (self VertexArray) Getbounds() FloatRect
\brief Compute the bounding rectangle of a vertex array This function returns the axis-aligned rectangle that contains all the vertices of the array. \param vertexArray Vertex array objet \return Bounding rectangle of the vertex array sfFloatRect sfVertexArray_getBounds(sfVertexArray* vertexArray);
func (VertexArray) Getprimitivetype ¶
func (self VertexArray) Getprimitivetype() PrimitiveType
\brief Get the type of primitives drawn by a vertex array \param vertexArray Vertex array objet \return Primitive type sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray);
func (VertexArray) Resize ¶
func (self VertexArray) Resize(vertexCount uint)
\brief Resize the vertex array If \a vertexCount is greater than the current size, the previous vertices are kept and new (default-constructed) vertices are added. If \a vertexCount is less than the current size, existing vertices are removed from the array. \param vertexArray Vertex array objet \param vertexCount New size of the array (number of vertices) void sfVertexArray_resize(sfVertexArray* vertexArray, unsigned int vertexCount);
func (VertexArray) SetPrimitiveType ¶
func (self VertexArray) SetPrimitiveType(ptype PrimitiveType)
\brief Set the type of primitives of a vertex array This function defines how the vertices must be interpreted when it's time to draw them: \li As points \li As lines \li As triangles \li As quads The default primitive type is sfPoints. \param vertexArray Vertex array objet \param type Type of primitive void sfVertexArray_setPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType type);
type VideoMode ¶
type VideoMode struct {
Cref *C.sfVideoMode
}
sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting modes supported by the display device
func DesktopMode ¶
func DesktopMode() VideoMode
Get the current desktop video mode sfVideoMode sfVideoMode_getDesktopMode(void)
func FullscreenModes ¶
func FullscreenModes() []VideoMode
Retrieve all the video modes supported in fullscreen mode
When creating a fullscreen window, the video mode is restricted to be compatible with what the graphics driver and monitor support. This function returns the complete list of all video modes that can be used in fullscreen mode. The returned slice is sorted from best to worst, so that the first element will always give the best mode (higher width, height and bits-per-pixel). const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* Count)
func NewVideoMode ¶
func (VideoMode) BitsPerPixel ¶
func (VideoMode) IsValid ¶
Tell whether or not a video mode is valid The validity of video modes is only relevant when using fullscreen windows otherwise any video mode can be used with no restriction. *return true if the video mode is valid for fullscreen mode sfBool sfVideoMode_isValid(sfVideoMode mode)
type View ¶
func (View) Copy ¶
\brief Copy an existing view \param view View to copy \return Copied object sfView* sfView_copy(sfView* view);
func (View) Destroy ¶
func (self View) Destroy()
\brief Destroy an existing view \param view View to destroy void sfView_destroy(sfView* view);
func (View) GetCenter ¶
\brief Get the center of a view \param view View object \return Center of the view sfVector2f sfView_getCenter(const sfView* view);
func (View) GetRotation ¶
\brief Get the current orientation of a view \param view View object \return Rotation angle of the view, in degrees float sfView_getRotation(const sfView* view);
func (View) GetSize ¶
\brief Get the size of a view \param view View object \return Size of the view sfVector2f sfView_getSize(const sfView* view);
func (View) GetViewport ¶
\brief Get the target viewport rectangle of a view \param view View object \return Viewport rectangle, expressed as a factor of the target size sfFloatRect sfView_getViewport(const sfView* view);
func (View) Move ¶
\brief Move a view relatively to its current position \param view View object \param offset Offset void sfView_move(sfView* view, sfVector2f offset);
func (View) NewView ¶
\brief Create a default view This function creates a default view of (0, 0, 1000, 1000) \return A new sfView object sfView* sfView_create(void);
func (View) NewViewFromRect ¶
\brief Construct a view from a rectangle \param rectangle Rectangle defining the zone to display \return A new sfView object sfView* sfView_createFromRect(sfFloatRect rectangle);
func (View) Reset ¶
\brief Reset a view to the given rectangle Note that this function resets the rotation angle to 0. \param view View object \param rectangle Rectangle defining the zone to display void sfView_reset(sfView* view, sfFloatRect rectangle);
func (View) Rotate ¶
\brief Rotate a view relatively to its current orientation \param view View object \param angle Angle to rotate, in degrees void sfView_rotate(sfView* view, float angle);
func (View) SetCenter ¶
\brief Set the center of a view \param view View object \param center New center void sfView_setCenter(sfView* view, sfVector2f center);
func (View) SetRotation ¶
\brief Set the orientation of a view The default rotation of a view is 0 degree. \param view View object \param angle New angle, in degrees void sfView_setRotation(sfView* view, float angle);
func (View) SetSize ¶
\brief Set the size of a view \param view View object \param size New size of the view void sfView_setSize(sfView* view, sfVector2f size);
func (View) SetViewport ¶
\brief Set the target viewport of a view The viewport is the rectangle into which the contents of the view are displayed, expressed as a factor (between 0 and 1) of the size of the render target to which the view is applied. For example, a view which takes the left side of the target would be defined by a rect of (0, 0, 0.5, 1). By default, a view has a viewport which covers the entire target. \param view View object \param viewport New viewport rectangle void sfView_setViewport(sfView* view, sfFloatRect viewport);
func (View) Zoom ¶
\brief Resize a view rectangle relatively to its current size Resizing the view simulates a zoom, as the zone displayed on screen grows or shrinks. \a factor is a multiplier: \li 1 keeps the size unchanged \li > 1 makes the view bigger (objects appear smaller) \li < 1 makes the view smaller (objects appear bigger) \param view View object \param factor Zoom factor to apply void sfView_zoom(sfView* view, float factor);
type Window ¶
type Window struct {
Cref CWindow
}
func NewWindow ¶
Construct a new window This function creates the window with the size and pixel depth defined in \a mode. An optional style can be passed to customize the look and behaviour of the window (borders, title bar, resizable, closable, ...). If \a style contains sfFullscreen, then \a mode must be a valid video mode. The fourth parameter is a pointer to a structure specifying advanced OpenGL context settings such as antialiasing, depth-buffer bits, etc. param mode Video mode to use (defines the width, height and depth of the rendering area of the window) param title Title of the window param style Window style param settings Additional settings for the underlying OpenGL context return A new Window. sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
func (Window) Close ¶
func (self Window) Close()
Close a window and destroy all the attached resources After calling this function, the sfWindow object remains valid, you must call sfWindow_destroy to actually delete it. All other functions such as sfWindow_pollEvent or sfWindow_display will still work (i.e. you don't have to test sfWindow_isOpen every time), and will have no effect on closed windows. \param window Window object void sfWindow_close(sfWindow* window);
func (Window) Destroy ¶
func (self Window) Destroy()
Destroy a window void sfWindow_destroy(sfWindow* window);
func (Window) Display ¶
func (self Window) Display()
Display on screen what has been rendered to the
window so far
This function is typically called after all OpenGL rendering has been done for the current frame, in order to show it on screen. \param window Window object void sfWindow_display(sfWindow* window);
func (Window) GetSize ¶
Get the size of the rendering region of a window The size doesn't include the titlebar and borders of the window. \param window Window object \return Size in pixels sfVector2u sfWindow_getSize(const sfWindow* window);
func (Window) IsOpen ¶
Tell whether or not a window is opened This function returns whether or not the window exists. Note that a hidden window (sfWindow_SetVisible(sfFalse)) will return sfTrue. \param window Window object \return sfTrue if the window is opened, sfFalse if it has been closed sfBool sfWindow_isOpen(const sfWindow* window);
func (Window) PollEvent ¶
Pop the event on top of events stack, if any, and return it This function is not blocking: if there's no pending event then it will return false and leave \a event unmodified. Note that more than one event may be present in the events stack, thus you should always call this function in a loop to make sure that you process every pending event in: window Window object in: event Event to be returned returns true if an event was returned, or false if the events stack was empty sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event);
func (Window) Position ¶
Get the position of a window \param window Window object \return (x, y) sfVector2i sfWindow_getPosition(const sfWindow* window); TODO evalutate which is better [ multiple return | vector type ]
func (Window) SetActive ¶
Activate or deactivate a window as the current target
for OpenGL rendering
A window is active only on the current thread, if you want to make it active on another thread you have to deactivate it on the previous thread first if it was active. Only one window can be active on a thread at a time, thus the window previously active (if any) automatically gets deactivated. \param window Window object \param active sfTrue to activate, sfFalse to deactivate \return sfTrue if operation was successful, sfFalse otherwise sfBool sfWindow_setActive(sfWindow* window, sfBool active);
func (Window) SetFramerateLimit ¶
Limit the framerate to a maximum fixed frequency If a limit is set, the window will use a small delay after each call to sfWindow_Display to ensure that the current frame lasted long enough to match the framerate limit. \param window Window object \param limit Framerate limit, in frames per seconds (use 0 to disable limit) void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit);
func (Window) SetIcon ¶
Change a window's icon \a pixels must be an array of \a width x \a height pixels in 32-bits RGBA format. \param window Window object \param width Icon's width, in pixels \param height Icon's height, in pixels \param pixels Pointer to the array of pixels in memory void sfWindow_setIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels);
func (Window) SetJoystickThreshold ¶
Change the joystick threshold The joystick threshold is the value below which no JoyMoved event will be generated. \param window Window object \param threshold New threshold, in the range [0, 100] void sfWindow_setJoystickThreshold(sfWindow* window, float threshold);
func (Window) SetKeyRepeatEnabled ¶
Enable or disable automatic key-repeat If key repeat is enabled, you will receive repeated KeyPress events while keeping a key pressed. If it is disabled, you will only get a single event when the key is pressed. Key repeat is enabled by default. \param window Window object \param enabled sfTrue to enable, sfFalse to disable void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled);
func (Window) SetMouseCursorVisible ¶
Show or hide the mouse cursor \param window Window object \param visible sfTrue to show, sfFalse to hide void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
func (Window) SetPosition ¶
Change the position of a window on screen This function only works for top-level windows (i.e. it will be ignored for windows created from the handle of a child window/control). \param window Window object \param position New position of the window, in pixels void sfWindow_setPosition(sfWindow* window, sfVector2i position); TODO evalutate which is better [ multiple return | vector type ]
func (Window) SetSize ¶
TODO WHY THIS NO WORK. Change the size of the rendering region of a window \param window Window object \param size New size, in pixels void sfWindow_setSize(sfWindow* window, sfVector2u size);
func (Window) SetTitle ¶
Change the title of a window \param window Window object \param title New title void sfWindow_setTitle(sfWindow* window, const char* title);
func (Window) SetVerticalSyncEnabled ¶
Enable or disable vertical synchronization Activating vertical synchronization will limit the number of frames displayed to the refresh rate of the monitor. This can avoid some visual artifacts, and limit the framerate to a good value (but not constant across different computers). \param window Window object \param enabled sfTrue to enable v-sync, sfFalse to deactivate void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled);
func (Window) SetVisible ¶
Show or hide a window \param window Window object \param visible sfTrue to show the window, sfFalse to hide it void sfWindow_setVisible(sfWindow* window, sfBool visible);
func (Window) Settings ¶
func (self Window) Settings() ContextSettings
Get the settings of the OpenGL context of a window Note that these settings may be different from what was passed to the sfWindow_create function, if one or more settings were not supported. In this case, SFML chose the closest match. \param window Window object \return Structure containing the OpenGL context settings sfContextSettings sfWindow_getSettings(const sfWindow* window);
type WindowHandle ¶
type WindowHandle struct {
Cref C.sfWindowHandle
}
Source Files
¶
- aud-listener.go
- aud-music.go
- aud-sound-stream.go
- aud-sound.go
- aud-soundbuffer.go
- aud-soundbufferrecorder.go
- gfx-circle-shape.go
- gfx-color.go
- gfx-convexshape.go
- gfx-font.go
- gfx-image.go
- gfx-primitivetype.go
- gfx-rect.go
- gfx-rectangle-shape.go
- gfx-render-texture.go
- gfx-render-window.go
- gfx-shader.go
- gfx-sprite.go
- gfx-text.go
- gfx-texture.go
- gfx-transform.go
- gfx-vertex.go
- gfx-vertexarray.go
- gfx-view.go
- sys-clock.go
- sys-debug.go
- sys-time.go
- sys-vector2.go
- sys-vector3.go
- util.go
- win-context-settings.go
- win-context.go
- win-event.go
- win-joystick.go
- win-keyboard.go
- win-mouse.go
- win-video-mode.go
- win-window.go