module Codec.Tiled.Object.Text
( Text(..)
, empty
) where
import Data.Text qualified as The
import GHC.Generics (Generic)
import Codec.Tiled.Aeson (FromJSON(..), ToJSON(..), genericParseJSON, genericToJSON)
data Text = Text
{ Text -> Maybe Bool
bold :: Maybe Bool
, Text -> Maybe Text
color :: Maybe The.Text
, Text -> Maybe Text
fontFamily :: Maybe The.Text
, Text -> Maybe Text
hAlign :: Maybe The.Text
, Text -> Maybe Bool
italic :: Maybe Bool
, Text -> Maybe Bool
kerning :: Maybe Bool
, Text -> Maybe Int
pixelSize :: Maybe Int
, Text -> Maybe Bool
strikeout :: Maybe Bool
, Text -> Text
text :: The.Text
, Text -> Maybe Bool
underline :: Maybe Bool
, Text -> Maybe Text
vAlign :: Maybe The.Text
, Text -> Maybe Bool
wrap :: Maybe Bool
}
deriving (Text -> Text -> Bool
(Text -> Text -> Bool) -> (Text -> Text -> Bool) -> Eq Text
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Text -> Text -> Bool
$c/= :: Text -> Text -> Bool
== :: Text -> Text -> Bool
$c== :: Text -> Text -> Bool
Eq, Int -> Text -> ShowS
[Text] -> ShowS
Text -> String
(Int -> Text -> ShowS)
-> (Text -> String) -> ([Text] -> ShowS) -> Show Text
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Text] -> ShowS
$cshowList :: [Text] -> ShowS
show :: Text -> String
$cshow :: Text -> String
showsPrec :: Int -> Text -> ShowS
$cshowsPrec :: Int -> Text -> ShowS
Show, (forall x. Text -> Rep Text x)
-> (forall x. Rep Text x -> Text) -> Generic Text
forall x. Rep Text x -> Text
forall x. Text -> Rep Text x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Text x -> Text
$cfrom :: forall x. Text -> Rep Text x
Generic)
instance FromJSON Text where
parseJSON :: Value -> Parser Text
parseJSON = Value -> Parser Text
forall a. (Generic a, GFromJSON Zero (Rep a)) => Value -> Parser a
genericParseJSON
instance ToJSON Text where
toJSON :: Text -> Value
toJSON = Text -> Value
forall a. (Generic a, GToJSON' Value Zero (Rep a)) => a -> Value
genericToJSON
empty :: Text
empty :: Text
empty = Text :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Int
-> Maybe Bool
-> Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Text
Text
{ bold :: Maybe Bool
bold = Maybe Bool
forall a. Maybe a
Nothing
, color :: Maybe Text
color = Maybe Text
forall a. Maybe a
Nothing
, fontFamily :: Maybe Text
fontFamily = Maybe Text
forall a. Maybe a
Nothing
, hAlign :: Maybe Text
hAlign = Maybe Text
forall a. Maybe a
Nothing
, italic :: Maybe Bool
italic = Maybe Bool
forall a. Maybe a
Nothing
, kerning :: Maybe Bool
kerning = Maybe Bool
forall a. Maybe a
Nothing
, pixelSize :: Maybe Int
pixelSize = Maybe Int
forall a. Maybe a
Nothing
, strikeout :: Maybe Bool
strikeout = Maybe Bool
forall a. Maybe a
Nothing
, text :: Text
text = Text
""
, underline :: Maybe Bool
underline = Maybe Bool
forall a. Maybe a
Nothing
, vAlign :: Maybe Text
vAlign = Maybe Text
forall a. Maybe a
Nothing
, wrap :: Maybe Bool
wrap = Maybe Bool
forall a. Maybe a
Nothing
}