mobile.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2019 The Ebiten Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // Package mobile provides functions for mobile platforms (Android and iOS).
  15. //
  16. // This package is used when you use `ebitenmobile bind`.
  17. //
  18. // For usage, see https://ebitengine.org/en/documents/mobile.html.
  19. package mobile
  20. import (
  21. "github.com/hajimehoshi/ebiten/v2"
  22. )
  23. // SetGame sets a mobile game.
  24. //
  25. // SetGame is expected to be called only once.
  26. //
  27. // SetGame can be called anytime. Until SetGame is called, the game does not start.
  28. func SetGame(game ebiten.Game) {
  29. SetGameWithOptions(game, nil)
  30. }
  31. // SetGameWithOptions sets a mobile game with the specified options.
  32. //
  33. // SetGameWithOptions is expected to be called only once.
  34. //
  35. // SetGameWithOptions can be called anytime. Until SetGameWithOptions is called, the game does not start.
  36. func SetGameWithOptions(game ebiten.Game, options *ebiten.RunGameOptions) {
  37. setGame(game, options)
  38. }